aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.rs33
1 files changed, 28 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs
index 5e9a51e..ebc9d71 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -8,24 +8,45 @@ use clang::{Clang, Index};
const TARGET_TAG: &str = "v3.1.5";
fn main() {
- assert_eq!(current_dir().unwrap(), Path::new(env!("CARGO_MANIFEST_DIR")), "running in the wrong place");
+ assert_eq!(
+ current_dir().unwrap(),
+ Path::new(env!("CARGO_MANIFEST_DIR")),
+ "running in the wrong place"
+ );
create_dir_all("out").unwrap();
set_current_dir("out").unwrap();
if metadata("orig").is_err() {
println!("cloning wxWidgets source...");
let git_clone = Command::new("git")
- .args(&["clone", "--quiet", "https://github.com/wxWidgets/wxWidgets.git", "orig", "--depth", "1"])
+ .args(&[
+ "clone",
+ "--quiet",
+ "https://github.com/wxWidgets/wxWidgets.git",
+ "orig",
+ "--depth",
+ "1",
+ ])
.status()
.unwrap();
assert!(git_clone.success());
let git_config = Command::new("git")
- .args(&["-C", "orig", "config", "--local", "advice.detachedHead", "false"])
+ .args(&[
+ "-C",
+ "orig",
+ "config",
+ "--local",
+ "advice.detachedHead",
+ "false",
+ ])
.status()
.unwrap();
assert!(git_config.success());
}
- let git_tag = Command::new("git").args(&["-C", "orig", "describe"]).output().unwrap();
+ let git_tag = Command::new("git")
+ .args(&["-C", "orig", "describe"])
+ .output()
+ .unwrap();
if String::from_utf8(git_tag.stdout).unwrap().trim() != TARGET_TAG {
let git_checkout = Command::new("git")
.args(&["-C", "orig", "checkout", "--quiet", TARGET_TAG])
@@ -37,7 +58,9 @@ fn main() {
if metadata("new").is_err() {
println!("creating wx crate...");
let cargo_new = Command::new("cargo")
- .args(&["new", "--quiet", "--vcs", "none", "--lib", "--name", "wx", "new"])
+ .args(&[
+ "new", "--quiet", "--vcs", "none", "--lib", "--name", "wx", "new",
+ ])
.status()
.unwrap();
assert!(cargo_new.success());