55 lines
3.7 KiB
C++
55 lines
3.7 KiB
C++
/*
|
|
dropshell-tool
|
|
|
|
dropshell-tool install <tool_name>
|
|
- 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/<tool_name>/
|
|
- 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 <tool_name> autocomplete <args>
|
|
- creates a ~/.config/dropshell-tool/tool_name.json file, which contains the tool's name, version (by running <tool_name> 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 <tool_name:ARCH> <folder>
|
|
- 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 <tool_name>
|
|
- 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 <args>
|
|
- 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 <tool_name>
|
|
- creates a new tool source directory in relative path <tool_name> 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
|
|
|
|
|
|
*/ |