:-'Generic Commit'
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
static constexpr const char* SERVER_HOST = "getbin.xyz";
|
||||
static constexpr const char* SERVER_HOST = "tools.dropshell.app";
|
||||
|
||||
GetbinClient::GetbinClient() {}
|
||||
|
||||
|
@ -9,10 +9,10 @@
|
||||
- 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>/
|
||||
- downloads the tool archive (tgz) from tools.dropshell.app (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
|
||||
- creates a ~/.config/dropshell-tool/tool_name.json file, which contains the tool's name, version (by running <tool_name> version), hash from tools.dropshell.app, 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
|
||||
@ -22,13 +22,13 @@
|
||||
|
||||
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.
|
||||
- creates a tgz archive of the folder, and uploads it to tools.dropshell.app'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
|
||||
- uses the token ~/.config/tools.dropshell.app/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)
|
||||
- compares the hash from the ~/.config/dropshell-tool/tool_name.json file with the hash from tools.dropshell.app (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 tools.dropshell.app (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
|
||||
@ -181,13 +181,13 @@ int publish_tool(int argc, char* argv[]) {
|
||||
std::cerr << "Failed to create archive." << std::endl;
|
||||
return 1;
|
||||
}
|
||||
std::filesystem::path tokenPath = std::filesystem::path(home) / ".config/getbin.xyz/write_token.txt";
|
||||
std::filesystem::path tokenPath = std::filesystem::path(home) / ".config/tools.dropshell.app/write_token.txt";
|
||||
std::string token;
|
||||
if (std::filesystem::exists(tokenPath)) {
|
||||
std::ifstream tfile(tokenPath);
|
||||
std::getline(tfile, token);
|
||||
} else {
|
||||
std::cout << "Enter getbin.xyz write token: ";
|
||||
std::cout << "Enter tools.dropshell.app write token: ";
|
||||
std::getline(std::cin, token);
|
||||
std::filesystem::create_directories(tokenPath.parent_path());
|
||||
std::ofstream tfile(tokenPath);
|
||||
|
Reference in New Issue
Block a user