Update 'rails' script to load Pry
authorKane York <rikingcoding@gmail.com>
Sat, 17 May 2014 19:53:12 +0000 (12:53 -0700)
committerKane York <rikingcoding@gmail.com>
Sat, 17 May 2014 19:53:12 +0000 (12:53 -0700)
Requires discourse/discourse@c03866a5bced768ebdfe479c2d2931cda7289518 to function

templates/web.template.yml

index 0e7c9307f2017aab86572b59441edc8314d4579e..11ef90859b769a07b14172050eb4a28f0ee565ce 100644 (file)
@@ -132,7 +132,13 @@ run:
      chmod: +x
      contents: |
        #!/bin/bash
-       (cd /var/www/discourse && RAILS_ENV=production sudo -E -u discourse bundle exec script/rails "$@")
+       # If they requested a console, load pry instead
+       if [ "$@" == "c" -o "$@" == "console" ]
+       then
+        (cd /var/www/discourse && RAILS_ENV=production sudo -E -u discourse bundle exec pry -r ./config/environment)
+       else
+        (cd /var/www/discourse && RAILS_ENV=production sudo -E -u discourse bundle exec script/rails "$@")
+       fi
 
   - file:
      path: /usr/local/bin/rake