Skip to content

Commit e927550

Browse files
committed
Simplify allowrd DB options for the sandbox
Only allow those compatible with `rails new --database=…` except for `sqlite` that is transformed to `sqlite3` so it continues to work with the CircleCI ORB.
1 parent 2eede64 commit e927550

1 file changed

Lines changed: 3 additions & 22 deletions

File tree

  • lib/solidus_dev_support/templates/extension/bin

lib/solidus_dev_support/templates/extension/bin/sandbox.tt

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,7 @@
33
set -e
44
test -z "${DEBUG+empty_string}" || set -x
55

6-
case "$DB" in
7-
postgres|postgresql)
8-
RAILSDB="postgresql"
9-
;;
10-
mysql)
11-
RAILSDB="mysql"
12-
;;
13-
sqlite3|sqlite)
14-
RAILSDB="sqlite3"
15-
;;
16-
'')
17-
echo "~~> Use 'export DB=[postgres|mysql|sqlite]' to control the DB adapter"
18-
RAILSDB="sqlite3"
19-
;;
20-
*)
21-
echo "Invalid value specified for the Solidus sandbox: DB=\"$DB\"."
22-
echo "Please use 'postgres', 'mysql', or 'sqlite' instead."
23-
exit 1
24-
;;
25-
esac
26-
echo "~~> Using $RAILSDB as the database engine"
6+
test "$DB" = "sqlite" && export DB="sqlite3"
277

288
if [ -z "$SOLIDUS_BRANCH" ]
299
then
@@ -47,7 +27,8 @@ function unbundled {
4727
}
4828

4929
rm -rf ./sandbox
50-
unbundled bundle exec rails new sandbox --database="$RAILSDB" \
30+
unbundled bundle exec rails new sandbox \
31+
--database="${DB:-sqlite3}" \
5132
--skip-bundle \
5233
--skip-git \
5334
--skip-keeps \

0 commit comments

Comments
 (0)