Last active
July 2, 2025 13:17
-
-
Save andreyev/c34884942cca077b8c4cf8bf7cc3b127 to your computer and use it in GitHub Desktop.
gist-update.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
[[ -s .gist_id ]] || ( echo "No gist id found"; exit 1) | |
# .gist_id file format: '5230a387ba343d103d9b414be2215a55:gh-update.sh' | |
export GIST_ID=$(cat .gist_id) | |
STATUS_CODE=$(curl -w "%{http_code}" -s https://gist.githubusercontent.com/andreyev/${GIST_ID%%:*}/raw/${GIST_ID##*:} -o run.sh) | |
if [[ ${STATUS_CODE} != "200" ]]; then | |
echo "No gist file found" | |
rm run.sh | |
exit 1 | |
else | |
bash -$- run.sh | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment