Skip to content

Instantly share code, notes, and snippets.

@stordahl
Created July 14, 2024 01:23
Show Gist options
  • Save stordahl/348c2a43cced445015cb5c6604667ee7 to your computer and use it in GitHub Desktop.
Save stordahl/348c2a43cced445015cb5c6604667ee7 to your computer and use it in GitHub Desktop.
Buggy Install Script
#!/usr/bin/env bash
if [ "$1" = "--local" ]; then
echo "Building source..."
make build
sudo cp build/standup /usr/local/bin
echo "Installed local version of standup!"
exit 0
fi
owner='stordahl'
repo='standup'
filename='standup'
echo "fetching latest version"
latest_version=$(
curl -sI https://github.com/$owner/$repo/releases/latest |
grep -i location |
sed -e 's|.*tag/||' -e 's|/.*||'
)
# Check if latest_version is not empty
if [ -z "$latest_version" ]; then
echo "Failed to fetch the latest version."
exit 1
fi
echo "version: $latest_version"
link="https://github.com/$owner/$repo/releases/download/$latest_version/$filename"
echo "$link" # outputs /standupgithub.com/stordahl/standup/releases/download/0.1-alpha
#curl -o "destination/folder/$filename" -L "$link"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment