Skip to content

Commit 19cac44

Browse files
committed
allow specific versions to be installed
1 parent 5e6bb3c commit 19cac44

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

install.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,28 @@ print_help() {
1212

1313
default_install_dir="/usr/local/bin"
1414
install_dir=$default_install_dir
15-
install_dir_opt=${1:-}
16-
if [ "$install_dir_opt" ]; then
17-
install_dir="$install_dir_opt"
18-
fi
15+
# install_dir_opt=${1:-}
16+
# if [ "$install_dir_opt" ]; then
17+
# install_dir="$install_dir_opt"
18+
# fi
1919

2020
download_dir=/tmp
2121

2222
latest_release="$(curl -sL https://raw.githubusercontent.com/alekcz/pcp/master/resources/PCP_RELEASED_VERSION)"
23+
target_release="${1-$latest_release}"
2324

2425
case "$(uname -s)" in
2526
Linux*) platform=linux;;
2627
Darwin*) platform=macos;;
2728
esac
2829

29-
download_url="https://github.com/alekcz/pcp/releases/download/$latest_release/pcp-$latest_release-$platform-amd64.zip"
30+
download_url="https://github.com/alekcz/pcp/releases/download/$target_release/pcp-$target_release-$platform-amd64.zip"
3031

3132
cd "$download_dir"
3233
echo -e "Downloading $download_url."
33-
curl -o "pcp-$latest_release-$platform-amd64.zip" -sL "https://github.com/alekcz/pcp/releases/download/$latest_release/pcp-$latest_release-$platform-amd64.zip"
34-
unzip -qqo "pcp-$latest_release-$platform-amd64.zip"
35-
rm "pcp-$latest_release-$platform-amd64.zip"
34+
curl -o "pcp-$target_release-$platform-amd64.zip" -sL "https://github.com/alekcz/pcp/releases/download/$target_release/pcp-$target_release-$platform-amd64.zip"
35+
unzip -qqo "pcp-$target_release-$platform-amd64.zip"
36+
rm "pcp-$target_release-$platform-amd64.zip"
3637
mkdir -p "/usr/local/etc/pcp-db"
3738
mkdir -p "$install_dir/pcp-templates"
3839

0 commit comments

Comments
 (0)