-
-
Notifications
You must be signed in to change notification settings - Fork 24
How to install Toshy with a single command
Copy and paste this into a terminal for a one-command install:
bash -c "$(curl -L https://raw.githubusercontent.com/RedBearAK/toshy/main/scripts/bootstrap.sh || wget -O - https://raw.githubusercontent.com/RedBearAK/toshy/main/scripts/bootstrap.sh)"
The bootstrap script that this downloads and executes mostly just does what the more complicated older command in the section below would have done, but will pause for 10 seconds and allow you to cancel the full setup script with Ctrl+C
, to possibly add installer flags or use alternate commands like ./setup_toshy.py show-env
before initiating the full setup.
Copy and paste this into a terminal for a one-command install:
URL="https://github.com/RedBearAK/toshy/archive/refs/heads/main.zip" && FN="toshy_$(date +%Y%m%d_%H%M)" && cd ~/Downloads && (curl -L "$URL" -o "$FN.zip" || wget "$URL" -O "$FN.zip" || { echo "Download failed."; exit 1; }) && mkdir -p "$FN" && unzip -o "$FN.zip" -d "$FN" || { echo "Extract failed. No unzip command?"; exit 1; } && cd "$FN/toshy-main" && (./setup_toshy.py install || echo "Setup script execution failed.")
Or, here is the same command using backslashes to separate it into different lines:
URL="https://github.com/RedBearAK/toshy/archive/refs/heads/main.zip" && \
FN="toshy_$(date +%Y%m%d_%H%M)" && \
cd ~/Downloads && \
(curl -L "$URL" -o "$FN.zip" || \
wget "$URL" -O "$FN.zip" || \
{ echo "Download failed."; exit 1; }) && \
mkdir -p "$FN" && \
unzip -o "$FN.zip" -d "$FN" || \
{ echo "Extract failed. No unzip command?"; exit 1; } && \
cd "$FN/toshy-main" && \
(./setup_toshy.py install || echo "Setup script execution failed.")
This single command doesn't give you a chance to use any of the installer options, but if it doesn't work you can still re-run the downloaded installer again with appropriate options. See below for details about what each part of the command does.
-
Set URL and Filename: The
URL
variable is set to the location of the GitHub zip file, andFN
is set to a timestamped filename to ensure uniqueness for each run of the quick install command.
URL="https://github.com/RedBearAK/toshy/archive/refs/heads/main.zip" && FN="toshy_$(date +%Y%m%d_%H%M)"
-
Change Directory: Changes to the
~/Downloads
directory to manage file downloads.
cd ~/Downloads
-
Download File: Attempts to download the latest zip file using
curl
. Ifcurl
is not available, it useswget
. An error message is displayed if both methods fail.
curl -L "$URL" -o "$FN.zip" || wget "$URL" -O "$FN.zip" || { echo "Download failed."; exit 1; }
-
Create Directory and Extract: Creates a directory with the same name as the timestamped file and uses
unzip
to extract the zip file contents into this directory. If there's nounzip
command on the system, this will fail and show the error message.
mkdir -p "$FN" && unzip -o "$FN.zip" -d "$FN" || { echo "Extract failed. No unzip command?"; exit 1; }
-
Navigate and Install: Changes into the directory containing the extracted project files (
toshy-main
within the timestamped folder) and runs the installation script.
cd "$FN/toshy-main" && (./setup_toshy.py install || echo "Setup script execution failed.")