Permalink
Browse files

Rescue from missing config files

  • Loading branch information...
1 parent 6b3d7ae commit 89ec210a950ec162c9eed264ae8ef2e0e4117d54 @quirkey quirkey committed Sep 26, 2010
Showing with 8 additions and 1 deletion.
  1. +3 −0 lib/soca/cli.rb
  2. +5 −1 lib/soca/pusher.rb
View
3 lib/soca/cli.rb
@@ -183,6 +183,9 @@ def logger
def pusher(env)
Soca::Pusher.new(appdir, env, config_file)
+ rescue => e
+ say e.message, :red
+ exit
end
end
View
6 lib/soca/pusher.rb
@@ -16,7 +16,11 @@ def config_path=(config_path)
end
def load_config
- @config = JSON.parse(File.read(config_path))
+ if File.readable?(config_path)
+ @config = JSON.parse(File.read(config_path))
+ else
+ raise "Could not find config at '#{config_path}'. Run `soca init`"
+ end
end
def load_couchapprc

0 comments on commit 89ec210

Please sign in to comment.