Skip to content

Commit

Permalink
change exit code meaning
Browse files Browse the repository at this point in the history
  • Loading branch information
leanmendoza committed Jul 5, 2023
1 parent 9d61168 commit 6d6b42d
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions rust/xtask/src/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,37 +31,36 @@ pub fn export() -> Result<(), anyhow::Error> {

// Do imports and one project open
let args = vec!["-e", "--path", "./../godot", "--headless", "--quit"];
let status = std::process::Command::new(program.as_str())
let status1 = std::process::Command::new(program.as_str())
.args(&args)
.status()
.expect("Failed to run Godot");

if !status.success() {
return Err(anyhow::anyhow!(
"(pre-import) Godot exited with non-zero status: {}",
status
));
}

// Export .pck
let pck_path = "./../exports/decentraland.godot.client.pck";
if std::path::Path::new(pck_path).exists() {
fs::remove_file(export_dir)?;
}
let args = vec![
"-e",
"--path",
"./../godot",
"--headless",
"--export-pack",
"linux",
"./../exports/decentraland.godot.client.pck",
pck_path,
"--quit",
];
let status = std::process::Command::new(program.as_str())
let status2 = std::process::Command::new(program.as_str())
.args(&args)
.status()
.expect("Failed to run Godot");
if !status.success() {

if !std::path::Path::new(pck_path).exists() {
return Err(anyhow::anyhow!(
"(export-pack) Godot exited with non-zero status: {}",
status
".pck file was not generated. pre-import godot status: {:?}, pck-export godot status: {:?}",
status1,
status2
));
}

Expand Down Expand Up @@ -103,5 +102,7 @@ pub fn export() -> Result<(), anyhow::Error> {
_ => {}
};

println!("Exported to {export_dir} succesfully!");

Ok(())
}

0 comments on commit 6d6b42d

Please sign in to comment.