#!/bin/sh
# Used in the sandbox rake task in Rakefile

case "$DB" in
postgres)
	RAILSDB="postgresql"
	;;
mysql)
	RAILSDB="mysql"
	;;
*)
	RAILSDB="sqlite3"
	;;
esac

rm -rf ./sandbox
bundle exec rails new sandbox --skip-bundle --database="$RAILSDB"
if [ ! -d "sandbox" ]; then
  echo 'sandbox rails application failed'
  exit 1
fi

cd ./sandbox
echo "gem 'solidus', :path => '..'" >> Gemfile
echo "gem 'solidus_auth_devise', :github => 'solidusio/solidus_auth_devise'" >> Gemfile

cat <<RUBY >> Gemfile
group :test, :development do
  platforms :mri do
    gem 'pry-byebug'
  end
end
RUBY

bundle install --gemfile Gemfile
bundle exec rails g spree:install --auto-accept --user_class=Spree::User --enforce_available_locales=true
bundle exec rails g spree:auth:install

#!/bin/sh
# Used in the sandbox rake task in Rakefile

case "$DB" in
postgres)
	RAILSDB="postgresql"
	;;
mysql)
	RAILSDB="mysql"
	;;
*)
	RAILSDB="sqlite3"
	;;
esac

rm -rf ./sandbox
bundle exec rails new sandbox --skip-bundle --database="$RAILSDB"
if [ ! -d "sandbox" ]; then
  echo 'sandbox rails application failed'
  exit 1
fi

cd ./sandbox
echo "gem 'solidus', :path => '..'" >> Gemfile
echo "gem 'solidus_auth_devise'" >> Gemfile

cat <<RUBY >> Gemfile
group :test, :development do
  platforms :mri do
    gem 'pry-byebug'
  end
end
RUBY

bundle install --gemfile Gemfile
bundle exec rails g spree:install --auto-accept --user_class=Spree::User --enforce_available_locales=true
bundle exec rails g spree:auth:install

Switch to gem for solidus_auth_devise
Switch to gem for solidus_auth_devise
