'Generic Commit'
This commit is contained in:
parent
72bceebde8
commit
ab87fecb39
@ -21,9 +21,6 @@ Install any tool from the getpkg registry:
|
|||||||
```bash
|
```bash
|
||||||
# Install a tool
|
# Install a tool
|
||||||
getpkg install ripgrep
|
getpkg install ripgrep
|
||||||
|
|
||||||
# Shorthand syntax (same as above)
|
|
||||||
getpkg ripgrep
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Managing Installed Tools
|
### Managing Installed Tools
|
||||||
@ -46,8 +43,7 @@ getpkg version
|
|||||||
|
|
||||||
### Core Package Management
|
### Core Package Management
|
||||||
|
|
||||||
- **`getpkg <tool_name>`** - Install or update a tool (shorthand)
|
- **`getpkg install <tool_name>`** - Install or update a tool
|
||||||
- **`getpkg install <tool_name>`** - Install or update a tool (explicit)
|
|
||||||
- **`getpkg uninstall <tool_name>`** - Remove an installed tool
|
- **`getpkg uninstall <tool_name>`** - Remove an installed tool
|
||||||
- **`getpkg update`** - Update getpkg and all installed tools
|
- **`getpkg update`** - Update getpkg and all installed tools
|
||||||
|
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
getpkg
|
getpkg
|
||||||
|
|
||||||
getpkg <tool_name>
|
getpkg install <tool_name>
|
||||||
- installs the specified tool (same as getpkg install <tool_name>)
|
|
||||||
- confirms getpkg is fully initialised:
|
- confirms getpkg is fully initialised:
|
||||||
- adds a line to the user's .bashrc file to source the getpkg ~/.bashrc_getpkg script, if it doesn't exist
|
- adds a line to the user's .bashrc file to source the getpkg ~/.bashrc_getpkg script, if it doesn't exist
|
||||||
- creates an empty ~/.bashrc_getpkg script if it doesn't exist
|
- creates an empty ~/.bashrc_getpkg script if it doesn't exist
|
||||||
@ -18,7 +17,7 @@
|
|||||||
- if setup_script.sh exists, run the script
|
- if setup_script.sh exists, run the script
|
||||||
|
|
||||||
getpkg install <tool_name>
|
getpkg install <tool_name>
|
||||||
- legacy syntax for installing a tool (same as getpkg <tool_name>)
|
- installs the specified tool
|
||||||
|
|
||||||
getpkg uninstall <tool_name>
|
getpkg uninstall <tool_name>
|
||||||
- uninstalls the specified tool
|
- uninstalls the specified tool
|
||||||
@ -674,7 +673,6 @@ void show_help() {
|
|||||||
std::cout << "Version: " << dropshell::VERSION << std::endl;
|
std::cout << "Version: " << dropshell::VERSION << std::endl;
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
std::cout << "USAGE:" << std::endl;
|
std::cout << "USAGE:" << std::endl;
|
||||||
std::cout << " getpkg <tool_name> Install/update the specified tool" << std::endl;
|
|
||||||
std::cout << " getpkg <command> [args...] Run a specific command" << std::endl;
|
std::cout << " getpkg <command> [args...] Run a specific command" << std::endl;
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
std::cout << "COMMANDS:" << std::endl;
|
std::cout << "COMMANDS:" << std::endl;
|
||||||
@ -709,8 +707,8 @@ void show_help() {
|
|||||||
std::cout << " help Show this help message" << std::endl;
|
std::cout << " help Show this help message" << std::endl;
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
std::cout << "EXAMPLES:" << std::endl;
|
std::cout << "EXAMPLES:" << std::endl;
|
||||||
std::cout << " getpkg ripgrep Install ripgrep tool" << std::endl;
|
std::cout << " getpkg install ripgrep Install ripgrep tool" << std::endl;
|
||||||
std::cout << " getpkg install myapp Install myapp (legacy syntax)" << std::endl;
|
std::cout << " getpkg install myapp Install myapp" << std::endl;
|
||||||
std::cout << " getpkg publish myapp:x86_64 ./build Publish architecture-specific build" << std::endl;
|
std::cout << " getpkg publish myapp:x86_64 ./build Publish architecture-specific build" << std::endl;
|
||||||
std::cout << " getpkg publish myapp ./build Publish universal build" << std::endl;
|
std::cout << " getpkg publish myapp ./build Publish universal build" << std::endl;
|
||||||
std::cout << " getpkg unpublish myapp:x86_64 Remove published myapp" << std::endl;
|
std::cout << " getpkg unpublish myapp:x86_64 Remove published myapp" << std::endl;
|
||||||
@ -768,9 +766,9 @@ help
|
|||||||
} else if (command == "help") {
|
} else if (command == "help") {
|
||||||
show_help();
|
show_help();
|
||||||
} else {
|
} else {
|
||||||
// Assume it's a tool name and install it
|
std::cerr << "Unknown command: " << command << std::endl;
|
||||||
char* fakeArgv[] = {argv[0], (char*)"install", argv[1]};
|
std::cerr << "Use 'getpkg help' for usage information." << std::endl;
|
||||||
return install_tool(3, fakeArgv);
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
@ -313,18 +313,18 @@ if [ -n "${SOS_WRITE_TOKEN:-}" ]; then
|
|||||||
print_test_result "Bashrc modifications for PATH and autocomplete" 1
|
print_test_result "Bashrc modifications for PATH and autocomplete" 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Test 12: Direct tool name install (shortcut syntax)
|
# Test 12: Reinstall after manual removal
|
||||||
echo -e "\nTest 12: Direct tool install syntax"
|
echo -e "\nTest 12: Reinstall after manual removal"
|
||||||
# First remove the tool
|
# First remove the tool
|
||||||
rm -rf ~/.getpkg/"${TEST_TOOL_NAME}"
|
rm -rf ~/.getpkg/"${TEST_TOOL_NAME}"
|
||||||
rm -rf ~/.local/bin/getpkg/"${TEST_TOOL_NAME}"
|
rm -rf ~/.local/bin/getpkg/"${TEST_TOOL_NAME}"
|
||||||
rm -f ~/.config/getpkg/"${TEST_TOOL_NAME}.json"
|
rm -f ~/.config/getpkg/"${TEST_TOOL_NAME}.json"
|
||||||
|
|
||||||
DIRECT_INSTALL_OUTPUT=$(timeout 3 "$GETPKG" "$TEST_TOOL_NAME" 2>&1) || DIRECT_INSTALL_OUTPUT=""
|
REINSTALL_OUTPUT=$(timeout 3 "$GETPKG" install "$TEST_TOOL_NAME" 2>&1) || REINSTALL_OUTPUT=""
|
||||||
if [[ "$DIRECT_INSTALL_OUTPUT" =~ Installed\ ${TEST_TOOL_NAME}\ successfully ]] || [[ "$DIRECT_INSTALL_OUTPUT" =~ ${TEST_TOOL_NAME}\ is\ already\ up\ to\ date ]]; then
|
if [[ "$REINSTALL_OUTPUT" =~ Installed\ ${TEST_TOOL_NAME}\ successfully ]] || [[ "$REINSTALL_OUTPUT" =~ ${TEST_TOOL_NAME}\ is\ already\ up\ to\ date ]]; then
|
||||||
print_test_result "Direct tool name install syntax" 0
|
print_test_result "Reinstall after manual removal" 0
|
||||||
else
|
else
|
||||||
print_test_result "Direct tool name install syntax" 1
|
print_test_result "Reinstall after manual removal" 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Test 13: Update already installed tool (should say up to date)
|
# Test 13: Update already installed tool (should say up to date)
|
||||||
@ -341,7 +341,7 @@ if [ -n "${SOS_WRITE_TOKEN:-}" ]; then
|
|||||||
# Skip dependent tests
|
# Skip dependent tests
|
||||||
print_test_result "Tool files installed correctly" 1
|
print_test_result "Tool files installed correctly" 1
|
||||||
print_test_result "Bashrc modifications for PATH and autocomplete" 1
|
print_test_result "Bashrc modifications for PATH and autocomplete" 1
|
||||||
print_test_result "Direct tool name install syntax" 1
|
print_test_result "Reinstall after manual removal" 1
|
||||||
print_test_result "Update check recognizes up-to-date tool" 1
|
print_test_result "Update check recognizes up-to-date tool" 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -352,7 +352,7 @@ if [ -n "${SOS_WRITE_TOKEN:-}" ]; then
|
|||||||
print_test_result "Install tool from getpkg.xyz" 1
|
print_test_result "Install tool from getpkg.xyz" 1
|
||||||
print_test_result "Tool files installed correctly" 1
|
print_test_result "Tool files installed correctly" 1
|
||||||
print_test_result "Bashrc modifications for PATH and autocomplete" 1
|
print_test_result "Bashrc modifications for PATH and autocomplete" 1
|
||||||
print_test_result "Direct tool name install syntax" 1
|
print_test_result "Reinstall after manual removal" 1
|
||||||
print_test_result "Update check recognizes up-to-date tool" 1
|
print_test_result "Update check recognizes up-to-date tool" 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user