From cf41a8c1c50b914e316aa94b8d4be69414fa7980 Mon Sep 17 00:00:00 2001 From: Ole-Morten Duesund Date: Sun, 3 Aug 2025 19:05:30 +0200 Subject: [PATCH] feat: improve installation system with user-local and system-wide options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update justfile installation system to provide better user experience: Installation Improvements: - `just install` - installs to ~/bin (user-local, no sudo required) - `just system-install` - installs to /usr/local/bin (system-wide, requires sudo) - `just uninstall` - removes from ~/bin - `just system-uninstall` - removes from /usr/local/bin (requires sudo) Benefits: - User-local installation by default (follows Unix best practices) - No sudo required for personal installations - Clear separation between user and system installs - Easy uninstallation for both scenarios - Helpful PATH reminder for ~/bin installation Documentation Updates: - Update CLAUDE.md with new installation commands - Update IMPLEMENTATION_COMPARISON.md deployment examples - Include uninstall instructions for both methods This follows modern software distribution practices where user-local installation is preferred for development tools, with system-wide installation available when needed for shared environments. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- CLAUDE.md | 13 +++++++++++-- IMPLEMENTATION_COMPARISON.md | 12 ++++++------ justfile | 29 +++++++++++++++++++++++++++-- 3 files changed, 44 insertions(+), 10 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index b940f27..ba23357 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -23,8 +23,17 @@ just build-rust # Builds rust/target/release/mail2couch-rs # Build optimized release versions just build-release -# Install both binaries to /usr/local/bin -sudo just install +# Install both binaries to ~/bin (user-local) +just install + +# Install both binaries to /usr/local/bin (system-wide) +sudo just system-install + +# Uninstall from ~/bin +just uninstall + +# Uninstall from /usr/local/bin +sudo just system-uninstall # Run tests for both implementations just test diff --git a/IMPLEMENTATION_COMPARISON.md b/IMPLEMENTATION_COMPARISON.md index 92ab4ae..4288f27 100644 --- a/IMPLEMENTATION_COMPARISON.md +++ b/IMPLEMENTATION_COMPARISON.md @@ -493,13 +493,13 @@ export MAIL2COUCH_LOG_FORMAT=json ### Universal Installation ```bash -# Build and install both implementations -just build-release -sudo just install +# Build and install both implementations (user-local) +just install +# This installs to ~/bin/mail2couch-go and ~/bin/mail2couch-rs -# This installs: -# - /usr/local/bin/mail2couch-go -# - /usr/local/bin/mail2couch-rs +# Build and install both implementations (system-wide) +sudo just system-install +# This installs to /usr/local/bin/mail2couch-go and /usr/local/bin/mail2couch-rs ``` --- diff --git a/justfile b/justfile index a403f64..26b3101 100644 --- a/justfile +++ b/justfile @@ -31,14 +31,39 @@ build-go-release: # Build optimized Rust release (already built with --release above) build-rust-release: build-rust -# Install binaries to /usr/local/bin (requires sudo) +# Install binaries to ~/bin (user-local installation) install: build-release + @echo "Installing binaries to ~/bin..." + mkdir -p ~/bin + cp go/mail2couch-go ~/bin/ + cp rust/target/release/mail2couch-rs ~/bin/ + chmod +x ~/bin/mail2couch-go + chmod +x ~/bin/mail2couch-rs + @echo "✅ Installed mail2couch-go and mail2couch-rs to ~/bin" + @echo "💡 Make sure ~/bin is in your PATH" + +# Install binaries to /usr/local/bin (system-wide installation, requires sudo) +system-install: build-release @echo "Installing binaries to /usr/local/bin..." sudo cp go/mail2couch-go /usr/local/bin/ sudo cp rust/target/release/mail2couch-rs /usr/local/bin/ sudo chmod +x /usr/local/bin/mail2couch-go sudo chmod +x /usr/local/bin/mail2couch-rs - @echo "✅ Installed mail2couch-go and mail2couch-rs" + @echo "✅ Installed mail2couch-go and mail2couch-rs to /usr/local/bin" + +# Uninstall binaries from ~/bin +uninstall: + @echo "Uninstalling binaries from ~/bin..." + rm -f ~/bin/mail2couch-go + rm -f ~/bin/mail2couch-rs + @echo "✅ Uninstalled mail2couch-go and mail2couch-rs from ~/bin" + +# Uninstall binaries from /usr/local/bin (requires sudo) +system-uninstall: + @echo "Uninstalling binaries from /usr/local/bin..." + sudo rm -f /usr/local/bin/mail2couch-go + sudo rm -f /usr/local/bin/mail2couch-rs + @echo "✅ Uninstalled mail2couch-go and mail2couch-rs from /usr/local/bin" # Run tests for both implementations test: test-go test-rust