Skip to content

Commit

Permalink
Improve install-cli.sh robustness
Browse files Browse the repository at this point in the history
Add `--no-location` for `curl` to retrieve release url, without this parameter, if there is `location` config in `~/.curlrc`, the value of `release_url` will be empty, which will make the install process fail.
  • Loading branch information
PeterDaveHello authored May 26, 2023
1 parent bdb8adf commit a1207f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion install-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ os=$(uname -s)
arch=$(uname -m)
version=${1:-latest}

release_url=$(curl --silent --write-out "%{redirect_url}\n" --output /dev/null "https://dl.depot.dev/cli/download/$os/$arch/$version")
release_url=$(curl --silent --no-location --write-out "%{redirect_url}\n" --output /dev/null "https://dl.depot.dev/cli/download/$os/$arch/$version")
if [ ! "$release_url" ]; then
echo "Error: Unable to find a Depot CLI release for $os/$arch/$version - see https://github.com/depot/cli/releases for all versions" 1>&2
exit 1
Expand Down

0 comments on commit a1207f7

Please sign in to comment.