Skip to content

Commit 611a98f

Browse files
committed
Refactor sandbox.tt
-z string is null, that is, has zero length -n string is not null. Reference: - https://tldp.org/LDP/abs/html/comparison-ops.html
1 parent ef20862 commit 611a98f

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

  • lib/solidus_dev_support/templates/extension/bin

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
set -e
4-
if [ ! -z "$DEBUG" ]
4+
if [ -n "$DEBUG" ]
55
then
66
set -x
77
fi
@@ -28,14 +28,12 @@ sqlite3|sqlite)
2828
esac
2929
echo "~~> Using $RAILSDB as the database engine"
3030

31-
if [ -n "$SOLIDUS_BRANCH" ]
31+
if [ -z "$SOLIDUS_BRANCH" ]
3232
then
33-
BRANCH=$SOLIDUS_BRANCH
34-
else
3533
echo "~~> Use 'export SOLIDUS_BRANCH=[master|v3.2|...]' to control the Solidus branch"
36-
BRANCH="master"
34+
SOLIDUS_BRANCH="master"
3735
fi
38-
echo "~~> Using branch $BRANCH of solidus"
36+
echo "~~> Using branch $SOLIDUS_BRANCH of solidus"
3937

4038
if [ -z "$SOLIDUS_FRONTEND" ]
4139
then
@@ -68,7 +66,7 @@ fi
6866

6967
cd ./sandbox
7068
cat <<RUBY >> Gemfile
71-
gem 'solidus', github: 'solidusio/solidus', branch: '$BRANCH'
69+
gem 'solidus', github: 'solidusio/solidus', branch: '$SOLIDUS_BRANCH'
7270
gem 'rails-i18n'
7371
gem 'solidus_i18n'
7472

0 commit comments

Comments
 (0)