Updated webinstall.sh and install.sh

This commit is contained in:
Elia Farin
2025-05-30 16:21:52 -05:00
parent d972f36f67
commit 0b617c9e27
2 changed files with 28 additions and 21 deletions

View File

@@ -12,6 +12,7 @@ install () {
export SHELLPROFILE="$1" export SHELLPROFILE="$1"
mkdir $HOME/.steamtricks mkdir $HOME/.steamtricks
cp -r steamtricks/* $HOME/.steamtricks cp -r steamtricks/* $HOME/.steamtricks
chmod 755 $HOME/.steamtricks/bin/steamtricks
echo "export STEAMTRICKS_PREFIX=\"$HOME/.steamtricks\"">>"${SHELLPROFILE}" echo "export STEAMTRICKS_PREFIX=\"$HOME/.steamtricks\"">>"${SHELLPROFILE}"
echo "export PATH=\"\$PATH:$HOME/.steamtricks/bin\"">>"${SHELLPROFILE}" echo "export PATH=\"\$PATH:$HOME/.steamtricks/bin\"">>"${SHELLPROFILE}"

View File

@@ -2,21 +2,33 @@
export DOWNLOADURL="" export DOWNLOADURL=""
install_steamtricks () { unsupported_shell () {
export SHELLNAME="$1" echo "Your shell $SHELL is not supported by this install script"
export SHELLPROFILE="$HOME/.${SHELLNAME}rc" echo "You will need to manually install by extracting a tarball from"
mkdir -p ~/.steamtricks && curl "$DOWNLOADURL" | tar -xvC ~/.steamtricks/ || echo "Could not install steamtricks" echo "https://github.com/charwrangler404/steamtricks/releases to your home folder"
echo "export STEAMTRICKS_PREFIX=\"$HOME/.steamtricks\"">>$SHELLPROFILE echo "and setting the STEAMTRICKS_PREFIX to your shell's environment, as well as"
echo 'export PATH="$PATH:$HOME/.winetricks/bin"'>>$SHELLPROFILE echo "$HOME/.steamtricks/bin to your PATH"
echo "Installation complete! Please source your profile to apply changes"
} }
install_steamtricks_sh () { install () {
export $SHELLPROFILE="$HOME/.profile" export SHELLPROFILE="$1"
mkdir -p $HOME/.steamtricks && curl "$DOWNLOADURL" | tar -xvC $HOME/.steamtricks/ || echo "Could not install steamtricks" curl "$DOWNLOADURL" | tar -xvC $HOME/
echo "export STEAMTRICKS_PREFIX=\"$HOME/.steamtricks\"">>$SHELLPROFILE chmod 755 $HOME/.steamtricks/bin/steamtricks
echo 'export PATH="$PATH:$HOME/.winetricks/bin"'>>$SHELLPROFILE echo "export STEAMTRICKS_PREFIX=\"$HOME/.steamtricks\"">>"${SHELLPROFILE}"
echo "Installation complete! Please source your profile to apply changes" echo "export PATH=\"\$PATH:$HOME/.steamtricks/bin\"">>"${SHELLPROFILE}"
echo "Install completed! Please source your profile $SHELLPROFILE to load the changes!"
}
install_manager () {
case "$1" in
bash | zsh | yash) install "$HOME/.${1}rc"
;;
sh ) install "$HOME/.profile"
;;
*) unsupported_shell
;;
esac
} }
if [ "$EUID" -eq 0 ]; then if [ "$EUID" -eq 0 ]; then
@@ -25,11 +37,5 @@ if [ "$EUID" -eq 0 ]; then
fi fi
SHELLNAME=$(echo $SHELL | awk -F '/' '{print $NF}') SHELLNAME=$(echo $SHELL | awk -F '/' '{print $NF}')
case "$SHELLNAME" in
sh) install_steamtricks_sh install_manager $SHELLNAME
;;
bash | zsh | yash) install_steamtricks "$SHELLNAME"
;;
*) echo "You will need to install this by manually adding it to either your /etc/profile for system-wide installation or to your shell's profile"
;;
esac