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