Skip to content

Commit

Permalink
fix(install): Add -o flag to unzip to match tar (starship#3727)
Browse files Browse the repository at this point in the history
By default, unzip will attempt to query the user when files to be
installed already exist. Unfortunately, if the install script is run
with `sh -s`, unzip will read the remaining portion of the script as
input, resulting in a mess on the terminal.

This commit changes the unzip behavior to clobber existing files: this
already happens for platforms using tar, so it's not hugely breaking
(and I could find no evidence that we believe this is more likely to
cause issues on Windows)
  • Loading branch information
chipbuster authored Mar 10, 2022
1 parent a85f654 commit ef96727
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion install/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ unpack() {
return 0
;;
*.zip)
flags=$(test -z "${VERBOSE-}" && echo "-qq" || echo "")
flags=$(test -z "${VERBOSE-}" && echo "-qqo" || echo "-o")
UNZIP="${flags}" ${sudo} unzip "${archive}" -d "${bin_dir}"
return 0
;;
Expand Down

0 comments on commit ef96727

Please sign in to comment.