/* dropshell-tool dropshell-tool install - confirms dropshell-tool is fully initialised: - adds a line to the user's .bashrc file to source the dropshell-tool ~/.bashrc_dropshell_tool script, if it doesn't exist - creates an empty ~/.bashrc_dropshell_tool script if it doesn't exist - creates the ~/.config/dropshell-tool directory, if it does not exist - creates the ~/.local/bin/dropshell-tool directory, if it does not exist - removes the tool from the user's system if it is already installed, and the tool's entries in the ~/.bashrc_dropshell_tool script - downloads the tool archive (tgz) from getbin.xyz (tool_name:ARCH), where ARCH is the architecture of the user's system, and unpacks it to the new tool directory: ~/.local/bin/dropshell-tool// - sets the PATH to include the tool directory, by modifying the ~/.bashrc_dropshell_tool script - adds an entry for autocompletion for the tool to the ~/.bashrc_dropshell_tool script, where autocomplete just runs autocomplete - creates a ~/.config/dropshell-tool/tool_name.json file, which contains the tool's name, version (by running version), hash from getbin.xyz, and architecture - reads the json file from the tgz called dropshell-tool-config.json: - for each alias in the aliases array: - check if another command is using the alias, and continue only if not - check that the alias is not already in the ~/.bashrc_dropshell_tool script and continue only if not - add an entry to the ~/.bashrc_dropshell_tool script to run the tool via the alias - if the json file has a setup_script entry, run the script named in the entry in the tool directory - using sudo if the entry has sudo set to true. dropshell-tool publish - checks that dropshell-tool-config.json exists in the folder, and is valid (see above) - creates a tgz archive of the folder, and uploads it to getbin.xyz's simple object storage server. - prints the URL and hash of the uploaded archive - uses the token ~/.config/getbin.xyz/write_token.txt, or prompts the user for a token if it is not found and writes it to the file dropshell-tool update - compares the hash from the ~/.config/dropshell-tool/tool_name.json file with the hash from getbin.xyz (tool_name:ARCH), and continues only if they are different - checks the version from the ~/.config/dropshell-tool/tool_name.json file with the version from getbin.xyz (tool_name:ARCH), and continues only if the remote version is newer (installed is older) - installs the tool as per the install command dropshell-tool update all - runs update on all installed tools dropshell-tool autocomplete - shows autocomplete for dropshell-tool, and then exits - the tool list to choose from when calling install is hard coded in the autocomplete function dropshell-tool version - prints the version of dropshell-tool dropshell-tool create - creates a new tool source directory in relative path if it doesn't exist - creates a dropshell-tool-config.json file in the tool source directory if it doesn't exist, with the following entries: - aliases: an array of aliases for the tool - setup_script: the name of the setup script to run (setup_script.sh) - creates a setup_script.sh file in the tool source directory if it doesn't exist, that just prints a completion message and exits dropshell-tool help - shows this help message */