From 1d97e88eb8ba9c8d0858238be71d2e6462a31e78 Mon Sep 17 00:00:00 2001 From: Qi Xiao Date: Wed, 4 Sep 2024 15:36:56 +0100 Subject: [PATCH] tools/buildall.elv: Always remove existing zip files. --- tools/buildall.elv | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/buildall.elv b/tools/buildall.elv index 3ac2a7267..fac6ad41f 100755 --- a/tools/buildall.elv +++ b/tools/buildall.elv @@ -85,6 +85,11 @@ fn main {|go-pkg dst-dir &name=elvish &variant='' &keep-bin=$false| # fixed point in time to make the archive files reproducible. touch -d 2000-01-01T00:00:00Z $bin-name-in-archive if (eq $os windows) { + # If the zip file already exists, the zip command below will add the + # binary to the existing file. This is not the behavior we want, so always + # remove the zip file first. Passing -f makes the command succeed even if + # the file doesn't exist. + rm -f $archive-name zip -q $archive-name $bin-name-in-archive } else { # If we create a .tar.gz file directly with the tar command, the