fix(install): Add -o flag to unzip to match tar (#3727)

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)
This commit is contained in:
Kevin Song 2022-03-10 11:40:43 -06:00 committed by GitHub
parent a85f65473d
commit ef967271e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -116,7 +116,7 @@ unpack() {
return 0 return 0
;; ;;
*.zip) *.zip)
flags=$(test -z "${VERBOSE-}" && echo "-qq" || echo "") flags=$(test -z "${VERBOSE-}" && echo "-qqo" || echo "-o")
UNZIP="${flags}" ${sudo} unzip "${archive}" -d "${bin_dir}" UNZIP="${flags}" ${sudo} unzip "${archive}" -d "${bin_dir}"
return 0 return 0
;; ;;