diff --git a/conductor-setup.sh b/conductor-setup.sh new file mode 100755 index 0000000..68f8597 --- /dev/null +++ b/conductor-setup.sh @@ -0,0 +1,51 @@ +#!/bin/bash +set -e # Exit on any error + +echo "๐Ÿš€ Setting up Rails workspace..." + +# Load mise if available +if command -v mise &> /dev/null; then + eval "$(mise activate bash)" +fi + +# Check for required tools +if ! command -v ruby &> /dev/null; then + echo "โŒ Ruby is not installed. Please install Ruby first." + exit 1 +fi + +# Check Ruby version +RUBY_VERSION=$(ruby -v | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1) +REQUIRED_VERSION="3.2.0" + +if [ "$(printf '%s\n' "$REQUIRED_VERSION" "$RUBY_VERSION" | sort -V | head -n1)" != "$REQUIRED_VERSION" ]; then + echo "โŒ Ruby version $RUBY_VERSION is too old. Rails 8.0.3 requires Ruby >= $REQUIRED_VERSION" + echo " Please update Ruby using a version manager like rbenv, rvm, or asdf." + exit 1 +fi + +if ! command -v bundle &> /dev/null; then + echo "โŒ Bundler is not installed. Please install Bundler first." + exit 1 +fi + +# Copy environment files from root if they exist +if [ -f "$CONDUCTOR_ROOT_PATH/.env" ]; then + echo "๐Ÿ“‹ Copying .env file from root..." + cp "$CONDUCTOR_ROOT_PATH/.env" .env +fi + +if [ -f "$CONDUCTOR_ROOT_PATH/.env.local" ]; then + echo "๐Ÿ“‹ Copying .env.local file from root..." + cp "$CONDUCTOR_ROOT_PATH/.env.local" .env.local +fi + +# Install Ruby dependencies +echo "๐Ÿ“ฆ Installing Ruby gems..." +bundle install + +# Clear logs and temp files +echo "๐Ÿงน Cleaning logs and temp files..." +bin/rails log:clear tmp:clear + +echo "โœ… Setup complete! Click the Run button to start the Rails server." \ No newline at end of file diff --git a/conductor.json b/conductor.json new file mode 100644 index 0000000..6a4277a --- /dev/null +++ b/conductor.json @@ -0,0 +1,8 @@ +{ + "scripts": { + "setup": "./conductor-setup.sh", + "run": "bin/dev", + "archive": "" + }, + "runScriptMode": "nonconcurrent" +} \ No newline at end of file