mirror of https://github.com/go-gost/gost.git
streamline download/install process
(get binary only, eliminate unnecessary intermediate files)pull/857/head
parent
646d3f906c
commit
bc96fe3918
16
install.sh
16
install.sh
|
|
@ -68,18 +68,14 @@ install_gost() {
|
||||||
get_download_url="$base_url/tags/$version"
|
get_download_url="$base_url/tags/$version"
|
||||||
download_url=$(curl -s "$get_download_url" | awk -F'"' -v re=".*${os}.*${cpu_arch}.*" '/"browser_download_url":/ && $4 ~ re { print $4 }')
|
download_url=$(curl -s "$get_download_url" | awk -F'"' -v re=".*${os}.*${cpu_arch}.*" '/"browser_download_url":/ && $4 ~ re { print $4 }')
|
||||||
|
|
||||||
# Download the binary
|
# Download and install the binary
|
||||||
echo "Downloading gost version $version..."
|
install_path="/usr/local/bin"
|
||||||
curl -fsSL -o gost.tar.gz $download_url
|
echo "Downloading and installing gost version $version..."
|
||||||
|
curl -fsSL "$download_url" | tar -xzC "$install_path" gost
|
||||||
# Extract and install the binary
|
chmod +x "$install_path/gost"
|
||||||
echo "Installing gost..."
|
|
||||||
tar -xzf gost.tar.gz
|
|
||||||
chmod +x gost
|
|
||||||
mv gost /usr/local/bin/gost
|
|
||||||
|
|
||||||
# Remove binary from macOS quarantine when installing for first time
|
# Remove binary from macOS quarantine when installing for first time
|
||||||
[[ "$os" == "darwin" ]] && { xattr -d com.apple.quarantine /usr/local/bin/gost 2>&-; }
|
[[ "$os" == "darwin" ]] && { xattr -d com.apple.quarantine "$install_path/gost" 2>&-; }
|
||||||
|
|
||||||
echo "gost installation completed!"
|
echo "gost installation completed!"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue