Fix rails wrapper's arguments expansion problem.
authorHoward Yeh <howard@metacircus.com>
Sat, 2 May 2015 13:35:46 +0000 (21:35 +0800)
committerHoward Yeh <howard@metacircus.com>
Sat, 2 May 2015 13:35:46 +0000 (21:35 +0800)
"$@" expands to multiple words, and breaks `[` if there are multiple
arguments. Use "$*" == "console" instead, since this expands all the
arguments to a single word, which is what we want instead.

templates/web.template.yml

index c40452e11d8b54e45405b0f3fdf0c8fa9da0078f..d0b7519ef6fe2991a9e084a0816aaa3822dd0bbf 100644 (file)
@@ -149,7 +149,7 @@ run:
      contents: |
        #!/bin/bash
        # If they requested a console, load pry instead
-       if [ "$@" == "c" -o "$@" == "console" ]
+       if [ "$*" == "c" -o "$*" == "console" ]
        then
         (cd /var/www/discourse && RAILS_ENV=production sudo -H -E -u discourse bundle exec pry -r ./config/environment)
        else