Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fix the old interactive installer

Damian Legawiec12cd6b646a3b
diff --git a/.gitignore b/.gitignore
index c635e9c974..10de4dbf86 100644
--- a/.gitignore
+++ b/.gitignore
@@ -59,3 +59,4 @@ brakeman-*.*
**/node_modules
packages/*/package-lock.json
.turbo
+spree/
diff --git a/backend/engines/template.rb b/backend/template.rb
similarity index 90%
rename from backend/engines/template.rb
rename to backend/template.rb
index 83842bc774..33a4ec484f 100644
--- a/backend/engines/template.rb
+++ b/backend/template.rb
@@ -15,12 +15,12 @@ def add_gems
gem 'devise'
# Spree gems - core (includes core, api, cli)
- gem 'spree', USE_LOCAL_SPREE ? { path: '../' } : { version: SPREE_VERSION }
+ gem 'spree', USE_LOCAL_SPREE ? { path: '../backend/engines' } : { version: SPREE_VERSION }
# Optional Spree packages
- gem 'spree_emails', USE_LOCAL_SPREE ? { path: '../' } : { version: SPREE_VERSION }
- gem 'spree_sample', USE_LOCAL_SPREE ? { path: '../' } : { version: SPREE_VERSION }
- gem 'spree_admin', USE_LOCAL_SPREE ? { path: '../' } : { version: SPREE_VERSION }
+ gem 'spree_emails', USE_LOCAL_SPREE ? { path: '../backend/engines/emails' } : { version: SPREE_VERSION }
+ gem 'spree_sample', USE_LOCAL_SPREE ? { path: '../backend/engines/sample' } : { version: SPREE_VERSION }
+ gem 'spree_admin', USE_LOCAL_SPREE ? { path: '../backend/engines/admin' } : { version: SPREE_VERSION }
# Storefront packages (only when Rails storefront is selected)
if STOREFRONT_TYPE == 'rails'
diff --git a/backend/engines/install.sh b/install.sh
similarity index 99%
rename from backend/engines/install.sh
rename to install.sh
index 1c63e45f1c..0c79d0b5d9 100755
--- a/backend/engines/install.sh
+++ b/install.sh
@@ -81,7 +81,7 @@ RAILS_VERSION="${RAILS_VERSION:-8.1.2}"
APP_NAME=""
LOAD_SAMPLE_DATA="false"
STOREFRONT_TYPE=""
-TEMPLATE_URL="https://raw.githubusercontent.com/spree/spree/main/template.rb"
+TEMPLATE_URL="https://raw.githubusercontent.com/spree/spree/main/backend/template.rb"
VERBOSE=false
USE_LOCAL_SPREE=false
AUTO_ACCEPT=false
@@ -971,7 +971,7 @@ create_rails_app() {
fi
# Download template if running from URL, or use local if exists
- TEMPLATE_FILE="template.rb"
+ TEMPLATE_FILE="backend/template.rb"
if [ ! -f "$TEMPLATE_FILE" ]; then
print_info "Downloading Spree Rails template..."
curl -fsSL "$TEMPLATE_URL" -o "$TEMPLATE_FILE"
@@ -1071,7 +1071,7 @@ create_rails_app() {
fi
# Clean up downloaded template if it was downloaded
- if [ -f "$TEMPLATE_FILE" ] && [ "$TEMPLATE_FILE" != "template.rb" ]; then
+ if [ -f "$TEMPLATE_FILE" ] && [ "$TEMPLATE_FILE" != "backend/template.rb" ]; then
rm "$TEMPLATE_FILE"
fi