diff --git a/crates/client/src/release.rs b/crates/client/src/release.rs index 7ffbb51..e587024 100644 --- a/crates/client/src/release.rs +++ b/crates/client/src/release.rs @@ -47,7 +47,7 @@ const ARCHIVE: &str = "dist/source.tgz"; const VM: &str = "yumush-win"; const TARGET: &str = "yumush@127.0.0.1"; const PORT: &str = "2222"; -const EXTRACT: &str = "Remove-Item -Recurse -Force release -ErrorAction SilentlyContinue; New-Item -ItemType Directory release | Out-Null; tar xzf release.tgz -C release"; +const EXTRACT: &str = "Remove-Item -Recurse -Force release -ErrorAction SilentlyContinue; New-Item -ItemType Directory release | Out-Null; tar -xmzf release.tgz -C release"; pub fn is_source(path: &Path) -> bool { path.join("crates/client/Cargo.toml").is_file() && path.join(".git").exists() @@ -232,7 +232,7 @@ fn snapshot(source: &Path) -> Result<(), String> { )?; check( Command::new("tar") - .arg("xzf") + .arg("-xmzf") .arg(&tgz) .arg("-C") .arg(&tree), @@ -256,13 +256,13 @@ fn build_linux(job: Job, level: Level, source: &Path, cx: &Cx) -> Result<(), Str .env("CARGO_TERM_PROGRESS_WIDTH", "200") .env("CARGO_TERM_COLOR", "never") .stdout(Stdio::null()); + let built = source.join(format!("target/release-{name}/release/client")); + if built.exists() { + fs::remove_file(&built).map_err(|e| e.to_string())?; + } stream(&mut cmd, job, cx)?; let dest = source.join("dist").join(format!("x86_64_{name}-linux")); - fs::copy( - source.join(format!("target/release-{name}/release/client")), - &dest, - ) - .map_err(|e| e.to_string())?; + fs::copy(&built, &dest).map_err(|e| e.to_string())?; cx.send(Event::Built(job, dest)); cx.send(Event::Finished(job)); Ok(()) @@ -289,6 +289,7 @@ $env:Path += ";$env:USERPROFILE\.cargo\bin" $env:CARGO_TERM_PROGRESS_WHEN = 'always'; $env:CARGO_TERM_PROGRESS_WIDTH = '200'; $env:CARGO_TERM_COLOR = 'never' @' {toml}'@ | Set-Content -Encoding ascii level.toml +Remove-Item -Force ..\target-release-{name}\release\client.exe -ErrorAction SilentlyContinue cargo build --release -p client --target-dir ..\target-release-{name} --config level.toml exit $LASTEXITCODE "#,