Permalink
Browse files

Merge branch 'master' of github.com:ianha/LastResort

  • Loading branch information...
2 parents bd2a7da + 755d02d commit 0767a2921972af1f11dd72d1d25a76c94412a5f1 @shyndman shyndman committed May 3, 2012
Showing with 15 additions and 2 deletions.
  1. +2 −2 bin/last-resort
  2. +13 −0 lib/last-resort/commands.rb
View
@@ -25,10 +25,10 @@ command :new do |c|
end
end
-desc 'Describe run here'
-arg_name 'Describe arguments to run here'
+desc 'Run the last-resort server'
command :run do |c|
c.action do |global_options, options, args|
+ LastResort::Commands.run_heroku_or_rackup
end
end
@@ -1,4 +1,5 @@
require 'launchy'
+require 'config'
module LastResort
class Commands
@@ -141,5 +142,17 @@ def self.create_env
puts 'In order to run your project, you must modify the .env to include the domain name of your server.'.yellow
end
end
+
+ # ====== RUN
+
+ def self.run_heroku_or_rackup
+ begin
+ LastResort::Config::populate_env_if_required
+ rescue
+ puts 'Make sure to run "last-resort run" from a last-resort project'.yellow
+ return
+ end
+
+ end
end
end

0 comments on commit 0767a29

Please sign in to comment.