From fc93be5a9d77dcf763cfd047c2fd2ef3ce09b8d1 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Mon, 2 Mar 2026 22:01:51 -0500 Subject: [PATCH] Fix global install to use installDist instead of wiping project dir Option 2 now runs installDist and symlinks /usr/local/bin/jrunner and /usr/local/bin/jrq to the build output, avoiding the rm -rf of the project directory when the repo lives at the deploy path. Co-Authored-By: Claude Sonnet 4.6 --- deploy.sh | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/deploy.sh b/deploy.sh index a1898b2..244eacb 100755 --- a/deploy.sh +++ b/deploy.sh @@ -6,7 +6,7 @@ echo "=========================" echo "" echo "Select deployment option:" echo " 1) Local install (./jrunner/build/install)" -echo " 2) Global install (/opt/jrunner)" +echo " 2) Global install (installDist + /usr/local/bin symlinks)" echo " 3) Custom directory" echo "" read -p "Enter choice [1-3]: " choice @@ -58,8 +58,22 @@ if [ "$DEPLOY_MODE" = "local" ]; then echo "✅ Installed locally at: ${DEPLOY_DIR}" echo "Run './jrunner/build/install/jrunner/bin/jrunner --help' to test" echo "Run './jrunner/build/install/jrunner/bin/jrq' for query wrapper usage" +elif [ "$DEPLOY_MODE" = "global" ]; then + INSTALL_DIR="$(pwd)/jrunner/build/install/jrunner" + echo "Installing with gradle..." + ./gradlew installDist + echo "Installing jrq wrapper script..." + cp jrq "${INSTALL_DIR}/bin/jrq" + chmod +x "${INSTALL_DIR}/bin/jrq" + echo "Creating symlinks at /usr/local/bin/..." + sudo ln -sf "${INSTALL_DIR}/bin/jrunner" /usr/local/bin/jrunner + sudo ln -sf "${INSTALL_DIR}/bin/jrq" /usr/local/bin/jrq + echo "" + echo "✅ Installed at: ${INSTALL_DIR}" + echo "Symlinked to /usr/local/bin/ — run 'jrunner --help' to test" + echo " run 'jrq' for query wrapper usage" else - # Global or custom deployment + # Custom deployment if [ ! -d "${DEPLOY_DIR}" ]; then echo "Creating directory: ${DEPLOY_DIR}" sudo mkdir -p "${DEPLOY_DIR}" @@ -82,22 +96,10 @@ else sudo cp jrq "${DEPLOY_DIR}/bin/jrq" sudo chmod +x "${DEPLOY_DIR}/bin/jrq" - # Create symlink for global install - if [ "$DEPLOY_MODE" = "global" ]; then - echo "Creating symlinks at /usr/local/bin/..." - sudo ln -sf /opt/jrunner/bin/jrunner /usr/local/bin/jrunner - sudo ln -sf /opt/jrunner/bin/jrq /usr/local/bin/jrq - fi - echo "" echo "✅ Deployed to ${DEPLOY_DIR}" echo "Run '${DEPLOY_DIR}/bin/jrunner --help' to test" echo "Run '${DEPLOY_DIR}/bin/jrq' for query wrapper usage" - - if [ "$DEPLOY_MODE" = "global" ]; then - echo "Or simply: jrunner --help" - echo " jrq (for query wrapper)" - fi fi # Create ~/.jrqrc template if it doesn't exist