Compare commits
5 Commits
v2025.0630
...
main
Author | SHA1 | Date | |
---|---|---|---|
73c94f34f6 | |||
af4cbbcab0 | |||
a415eb0f91 | |||
83d6cf1603 | |||
fbaa3a4089 |
@ -109,7 +109,7 @@ function buildtestpublish() {
|
||||
# Add to projects list
|
||||
PROJECTS+=("$TOOLNAME")
|
||||
|
||||
#cd "$dir" || echo "Failed to cd to $dir"
|
||||
cd "$dir" || echo "Failed to cd to $dir"
|
||||
|
||||
subtitle "🔨 BUILDING $TOOLNAME_UPPER 🔨"
|
||||
if dothis build "$dir" "$TOOLNAME"; then
|
||||
|
@ -3,7 +3,7 @@ set -euo pipefail
|
||||
|
||||
# Get script directory - handle different execution contexts
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||
PROJECT="$(basename "$(dirname "${SCRIPT_DIR}")")"
|
||||
PROJECT="$(basename "${SCRIPT_DIR}")"
|
||||
|
||||
# Debug output for CI
|
||||
echo "${PROJECT} build script running from: ${SCRIPT_DIR}"
|
||||
|
@ -59,6 +59,10 @@ echo -e "${YELLOW}Running dehydrate tests...${NC}\n"
|
||||
|
||||
# Debug output
|
||||
echo "Looking for dehydrate at: $DEHYDRATE"
|
||||
echo "Workspace structure:"
|
||||
ls -la "${GITHUB_WORKSPACE}" 2>/dev/null || echo "Workspace not found"
|
||||
echo "Dehydrate directory contents:"
|
||||
ls -la "${GITHUB_WORKSPACE}/dehydrate" 2>/dev/null || echo "Dehydrate directory not found"
|
||||
echo "Output directory contents:"
|
||||
ls -la "$OUTPUT_DIR" 2>/dev/null || echo "Output directory not found"
|
||||
|
||||
@ -66,6 +70,18 @@ ls -la "$OUTPUT_DIR" 2>/dev/null || echo "Output directory not found"
|
||||
if [ ! -f "$DEHYDRATE" ]; then
|
||||
echo -e "${RED}Error: dehydrate binary not found at $DEHYDRATE${NC}"
|
||||
echo "Please run ./build.sh first to build dehydrate"
|
||||
|
||||
if [ -n "${GITEA_CONTAINER_NAME:-}" ]; then
|
||||
echo "Checking if build directory exists..."
|
||||
BUILD_DIR="${GITHUB_WORKSPACE}/dehydrate/build"
|
||||
if [ -d "$BUILD_DIR" ]; then
|
||||
echo "Build directory exists, checking contents:"
|
||||
ls -la "$BUILD_DIR"
|
||||
else
|
||||
echo "Build directory $BUILD_DIR does not exist"
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -3,7 +3,7 @@ set -euo pipefail
|
||||
|
||||
# Get script directory - handle different execution contexts
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||
PROJECT="$(basename "$(dirname "${SCRIPT_DIR}")")"
|
||||
PROJECT="$(basename "${SCRIPT_DIR}")"
|
||||
|
||||
# Debug output for CI
|
||||
echo "${PROJECT} build script running from: ${SCRIPT_DIR}"
|
||||
|
@ -1150,6 +1150,85 @@ void show_help() {
|
||||
std::cout << " ~/.local/bin/getpkg/ Installed tool binaries" << std::endl;
|
||||
}
|
||||
|
||||
int autocomplete_command(int argc, char* argv[]) {
|
||||
std::vector<std::string> args(argv + 2, argv + argc);
|
||||
|
||||
// If no arguments, return all commands
|
||||
if (args.empty()) {
|
||||
std::cout << "install\n";
|
||||
std::cout << "uninstall\n";
|
||||
std::cout << "publish\n";
|
||||
std::cout << "unpublish\n";
|
||||
std::cout << "update\n";
|
||||
std::cout << "version\n";
|
||||
std::cout << "create\n";
|
||||
std::cout << "hash\n";
|
||||
std::cout << "list\n";
|
||||
std::cout << "clean\n";
|
||||
std::cout << "help\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
const std::string& subcommand = args[0];
|
||||
|
||||
// Handle autocompletion for specific commands
|
||||
if (subcommand == "install") {
|
||||
// For install, we could suggest popular packages or recently published ones
|
||||
// For now, just return empty (no specific completions)
|
||||
return 0;
|
||||
} else if (subcommand == "uninstall") {
|
||||
// For uninstall, list installed tools
|
||||
std::filesystem::path configDir = std::filesystem::path(std::getenv("HOME")) / ".config" / "getpkg";
|
||||
if (std::filesystem::exists(configDir)) {
|
||||
for (const auto& entry : std::filesystem::directory_iterator(configDir)) {
|
||||
if (entry.path().extension() == ".json") {
|
||||
std::string toolName = entry.path().stem().string();
|
||||
std::cout << toolName << "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
} else if (subcommand == "publish") {
|
||||
// For publish, suggest architecture suffixes after tool name
|
||||
if (args.size() >= 2) {
|
||||
// If we have tool_name already, suggest architectures
|
||||
std::cout << "x86_64\n";
|
||||
std::cout << "aarch64\n";
|
||||
std::cout << "universal\n";
|
||||
}
|
||||
return 0;
|
||||
} else if (subcommand == "unpublish") {
|
||||
// For unpublish, list installed tools (similar to uninstall)
|
||||
std::filesystem::path configDir = std::filesystem::path(std::getenv("HOME")) / ".config" / "getpkg";
|
||||
if (std::filesystem::exists(configDir)) {
|
||||
for (const auto& entry : std::filesystem::directory_iterator(configDir)) {
|
||||
if (entry.path().extension() == ".json") {
|
||||
std::string toolName = entry.path().stem().string();
|
||||
std::cout << toolName << "\n";
|
||||
// Also suggest with architecture suffixes
|
||||
std::cout << toolName << ":x86_64\n";
|
||||
std::cout << toolName << ":aarch64\n";
|
||||
std::cout << toolName << ":universal\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
} else if (subcommand == "create") {
|
||||
// For create, no specific completions (tool name and directory are user-defined)
|
||||
return 0;
|
||||
} else if (subcommand == "hash") {
|
||||
// For hash, suggest file extensions
|
||||
if (args.size() >= 2) {
|
||||
std::cout << "*.tgz\n";
|
||||
std::cout << "*.tar.gz\n";
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// No specific completions for other commands
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // end anonymous namespace
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
@ -1169,19 +1248,7 @@ int main(int argc, char* argv[]) {
|
||||
} else if (command == "update") {
|
||||
return update_tool(argc, argv);
|
||||
} else if (command == "autocomplete") {
|
||||
std::vector<std::string> args(argv + 2, argv + argc);
|
||||
if (args.empty()) std::cout << R"(install
|
||||
uninstall
|
||||
publish
|
||||
unpublish
|
||||
update
|
||||
version
|
||||
create
|
||||
hash
|
||||
list
|
||||
clean
|
||||
help
|
||||
)";
|
||||
return autocomplete_command(argc, argv);
|
||||
} else if (command == "version") {
|
||||
std::cout << dropshell::VERSION << std::endl;
|
||||
} else if (command == "create") {
|
||||
|
Reference in New Issue
Block a user