Created
March 26, 2023 17:18
-
-
Save shanduur/343f7145da8d66b857cf46a81254c212 to your computer and use it in GitHub Desktop.
Updater Function for Shell
This file contains 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
function upd8 { | |
# upd8 function should be run manually or through CRON. | |
# It is used to install updates to apps that do not have | |
# verry user friendly installation methods through brew/yum/apt, | |
# or you want to have the newest version installed by their 'up' | |
# scripts. | |
# | |
# Add this to your | |
# - .bashrc | |
# - .zshrc | |
# - probably others | |
# | |
# And then invoke it like this: | |
# upd8 rust | |
# upd8 rust talosctl | |
for arg in "$@" | |
do | |
case $arg in | |
talosctl) | |
curl -sL https://talos.dev/install | sh | |
;; | |
rust) | |
if [ ! -x "$(command -v rustup)" ]; then | |
echo "rustup not installed, installing..." | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh | |
fi | |
rustup update | |
;; | |
*) | |
echo "unknown argument: $arg" | |
;; | |
esac | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment