:-'Generic Commit'

This commit is contained in:
Your Name
2025-05-28 21:21:23 +12:00
parent 401280cf23
commit 8556b683c7
4 changed files with 59 additions and 5 deletions

View File

@ -41,8 +41,8 @@
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
dropshell-tool create <tool_name> <directory_name>
- creates a new tool source directory in relative path <directory_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)
@ -244,12 +244,13 @@ int update_tool(int argc, char* argv[]) {
}
int create_tool(int argc, char* argv[]) {
if (argc < 3) {
std::cerr << "Usage: dropshell-tool create <tool_name>" << std::endl;
if (argc < 4) {
std::cerr << "Usage: dropshell-tool create <tool_name> <directory_name>" << std::endl;
return 1;
}
std::string toolName = argv[2];
std::filesystem::path toolDir = std::filesystem::current_path() / toolName;
std::string directoryName = argv[3];
std::filesystem::path toolDir = std::filesystem::current_path() / directoryName;
if (!std::filesystem::exists(toolDir)) {
std::filesystem::create_directories(toolDir);
std::cout << "Created directory: " << toolDir << std::endl;