Last active
January 26, 2025 18:17
-
-
Save davidgomesdev/76073543df474572a1a3c9247ae87b7e to your computer and use it in GitHub Desktop.
Script to run my Rust app repos
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
#!/usr/bin/env bash | |
# Colors | |
START=$(tput setaf 4) | |
SUCCESS=$(tput setaf 2) | |
WARNING=$(tput setaf 3) | |
ERROR=$(tput setaf 1) | |
INFO=$(tput setaf 6) | |
RESET=$(tput sgr0) | |
# Args | |
APP="$1" | |
# Constants | |
REPO_URL="https://github.com/DavidGomesDev/$1" | |
BINARY_PATH="/tmp/$1" | |
set -xe | |
arch=$(uname -m | xargs echo -n) | |
wget "$REPO_URL/releases/latest/download/$1-$arch" -o /tmp/$1-wget.log -O "$BINARY_PATH" || { cat /tmp/$1-wget.log ; exit 1; } | |
chmod +x "$BINARY_PATH" || exit 1 | |
"$BINARY_PATH" || (echo 'Executable failed.' && exit 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment