1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-25 15:29:32 -05:00

fix(cli): standalone bin corruption on M1 (#10311)

This commit is contained in:
Aaron O'Mullan 2021-04-23 12:33:45 +02:00 committed by GitHub
parent 6824ffb999
commit 2d722832c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -170,6 +170,10 @@ pub async fn write_standalone_binary(
if !has_trailer {
bail!("Could not compile: cannot overwrite {:?}.", &output);
}
// Remove file if it was indeed a deno compiled binary, to avoid corruption
// (see https://github.com/denoland/deno/issues/10310)
std::fs::remove_file(&output)?;
}
tokio::fs::write(&output, final_bin).await?;
#[cfg(unix)]