jrunner/deploy.sh
Paul Trowbridge 20d40f069d ensure parent directory exists in deploy script
Add mkdir -p to create parent directory if it doesn't exist. This allows
deploying to any path without requiring manual directory creation.

Example:
  ./deploy.sh /home/user/testing/jrunner

Now works even if /home/user/testing doesn't exist yet.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-06 22:07:03 -05:00

25 lines
682 B
Bash
Executable File

#!/bin/bash
set -e
# Default deployment directory
DEPLOY_DIR="${1:-/opt/jrunner}"
echo "Building jrunner..."
./gradlew build
echo "Deploying to ${DEPLOY_DIR}..."
sudo rm -rf "${DEPLOY_DIR}"
sudo mkdir -p "$(dirname "${DEPLOY_DIR}")"
sudo unzip jrunner/build/distributions/jrunner.zip -d "$(dirname "${DEPLOY_DIR}")"
# Only create symlink for default location
if [ "${DEPLOY_DIR}" = "/opt/jrunner" ]; then
echo "Creating symlink..."
sudo ln -sf /opt/jrunner/bin/jrunner /usr/local/bin/jrunner
echo "✅ Deployment complete!"
echo "Run 'jrunner --help' to test"
else
echo "✅ Deployment complete!"
echo "Run '${DEPLOY_DIR}/bin/jrunner --help' to test"
fi