From f5ba2e719b0358c49694ce2696eb7a3bedb719e9 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 19 Jul 2025 13:30:51 +1200 Subject: [PATCH] Modify whatsdirty/publish.sh --- .kiro/steering/product.md | 23 ++++++++++++ .kiro/steering/structure.md | 72 +++++++++++++++++++++++++++++++++++++ .kiro/steering/tech.md | 70 ++++++++++++++++++++++++++++++++++++ whatsdirty/publish.sh | 1 + 4 files changed, 166 insertions(+) create mode 100644 .kiro/steering/product.md create mode 100644 .kiro/steering/structure.md create mode 100644 .kiro/steering/tech.md diff --git a/.kiro/steering/product.md b/.kiro/steering/product.md new file mode 100644 index 0000000..f6a337a --- /dev/null +++ b/.kiro/steering/product.md @@ -0,0 +1,23 @@ +# Product Overview + +This repository contains **getpkg** - a command-line package manager for the dropshell ecosystem, along with a collection of developer tools. + +## Core Product +- **getpkg**: Package manager that installs tools to `~/.getpkg/` with symlinks in `~/.local/bin/getpkg/` +- Supports multiple architectures (x86_64, aarch64, universal) +- Tools are published to and downloaded from `getpkg.xyz` + +## Tool Collection +The repository includes several utility tools: +- **bb64**: Bash-compatible base64 encoder/decoder with custom character set +- **dehydrate**: Converts files/directories to C++ source code for embedding +- **whatsdirty**: Git repository status checker +- **sos**: Simple object storage client +- **gp**: Git push utility + +## Key Features +- Cross-platform tool distribution +- Automated installation with PATH setup +- Bash completion support +- Architecture-aware downloads with fallbacks +- Publishing system with authentication tokens \ No newline at end of file diff --git a/.kiro/steering/structure.md b/.kiro/steering/structure.md new file mode 100644 index 0000000..7b7f80c --- /dev/null +++ b/.kiro/steering/structure.md @@ -0,0 +1,72 @@ +# Project Structure + +## Repository Layout +``` +├── buildtestpublish_all.sh # Master build script for all projects +├── clean.sh # Global cleanup script +├── README.md # Main project documentation +└── / # Individual tool directories +``` + +## Tool Directory Structure + +### C++ Projects (CMake-based) +``` +/ +├── CMakeLists.txt # CMake configuration +├── build.sh # Build script +├── test.sh # Test script +├── clean.sh # Cleanup script +├── publish.sh # Publishing script +├── install.sh # Installation script +├── README.md # Tool documentation +├── Dockerfile.dropshell-build # Docker build configuration +├── src/ # Source code +│ ├── .cpp # Main source file +│ ├── version.hpp.in # Version template +│ └── ... # Additional sources +├── build/ # Build artifacts (generated) +├── output/ # Final executables (generated) +└── .vscode/ # VS Code configuration +``` + +### Shell Script Projects +``` +/ +├── # Executable shell script +├── build.sh # Build script (may be no-op) +├── test.sh # Test script +├── clean.sh # Cleanup script +├── publish.sh # Publishing script +└── setup_script.sh # Post-install setup (optional) +``` + +## Standard Files + +### Required Scripts +- **build.sh**: Builds the project (Docker for C++, no-op for shell) +- **test.sh**: Runs project tests +- **clean.sh**: Removes build artifacts +- **publish.sh**: Publishes to getpkg.xyz registry + +### Optional Files +- **install.sh**: System-wide installation script +- **setup_script.sh**: Post-install setup for getpkg +- **cmake_prebuild.sh**: Pre-build setup for CMake projects + +### Generated Directories +- **build/**: CMake build artifacts (C++ projects) +- **output/**: Final executables ready for distribution +- **test_*/**: Test-specific directories + +## Naming Conventions +- Tool directories match executable names +- C++ source files typically match project name +- Version templates use `.hpp.in` extension +- Docker files use `Dockerfile.dropshell-build` pattern +- Test directories prefixed with `test_` + +## Configuration Files +- **.gitignore**: Standard ignore patterns for build artifacts +- **.vscode/**: VS Code workspace settings +- **CMakeLists.txt**: Follows standard template with PROJECT_NAME parameter \ No newline at end of file diff --git a/.kiro/steering/tech.md b/.kiro/steering/tech.md new file mode 100644 index 0000000..a5c3517 --- /dev/null +++ b/.kiro/steering/tech.md @@ -0,0 +1,70 @@ +# Technology Stack + +## Build System +- **CMake 3.16+** with Ninja generator for C++ projects +- **Docker** containerized builds using `gitea.jde.nz/public/dropshell-build-base:latest` +- **Static linking** for all C++ executables (`-static` flag) + +## Languages & Standards +- **C++23** standard for all C++ projects +- **Bash** for shell scripts and simple tools +- **Shell scripts** follow `set -euo pipefail` pattern + +## Dependencies +- **nlohmann_json** for JSON handling in C++ projects +- **CPR (static)** for HTTP requests in getpkg +- Custom modules in `/usr/local/share/cmake/Modules` + +## Common Build Patterns + +### C++ Projects (CMake) +```bash +# Standard build command +cmake -G Ninja -S . -B ./build -DCMAKE_BUILD_TYPE=Debug -DPROJECT_NAME= +cmake --build ./build +``` + +### Docker Build (for C++ tools) +```bash +# Uses Dockerfile.dropshell-build pattern +docker build -t -build -f Dockerfile.dropshell-build --build-arg PROJECT= --output ./output . +``` + +### Shell Tools +- No build step required +- Executable shell scripts with proper shebang +- Use `chmod +x` for permissions + +## Common Commands + +### Build +```bash +./build.sh # Build individual project +./buildtestpublish_all.sh # Build all projects +``` + +### Test +```bash +./test.sh # Run tests for individual project +``` + +### Clean +```bash +./clean.sh # Clean build artifacts +``` + +### Publish +```bash +./publish.sh # Publish to getpkg.xyz (requires SOS_WRITE_TOKEN) +``` + +## Version Management +- Automatic timestamp-based versioning: `YYYY.MMDD.HHMM` +- Version configured via `version.hpp.in` template files +- Pre-build scripts (`cmake_prebuild.sh`) for additional setup + +## Environment Variables +- `CMAKE_BUILD_TYPE`: Debug/Release (default: Debug) +- `SOS_WRITE_TOKEN`: Authentication for publishing +- `NO_CACHE`: Skip Docker cache when set to "true" +- `PROJECT`: Project name for build scripts \ No newline at end of file diff --git a/whatsdirty/publish.sh b/whatsdirty/publish.sh index 7138cf8..c060123 100755 --- a/whatsdirty/publish.sh +++ b/whatsdirty/publish.sh @@ -25,6 +25,7 @@ GETPKG="${SCRIPT_DIR}/../getpkg/output/getpkg" TOOLDIR="${SCRIPT_DIR}/tool" mkdir -p "${TOOLDIR}" cp "${SCRIPT_DIR}/whatsdirty" "${TOOLDIR}/whatsdirty" +cp "${SCRIPT_DIR}/setup_script.sh" "${TOOLDIR}/" # publish universal tool. "${GETPKG}" publish "whatsdirty" "${TOOLDIR}"