bin/wd in whiskey_disk-0.6.16 vs bin/wd in whiskey_disk-0.6.17
- old
+ new
@@ -20,27 +20,42 @@
end
opts.on('-c', '--check', "do a staleness check before deploying") do |path|
options[:check] = 'true'
end
+
+ opts.on('-d', '--debug', "turn on debug mode (ssh -v and rake --trace)") do
+ options[:debug] = 'true'
+ end
+ opts.on('--version', 'show current version') do
+ puts File.read(File.expand_path(File.join(File.dirname(__FILE__), '..', 'VERSION')))
+ exit 0
+ end
+
opts.on_tail('-h', '--help', 'show this message') do
- raise opts.to_s
+ abort opts.to_s
end
end
-rest = op.parse(ARGV)
+begin
+ rest = op.parse(ARGV)
+rescue
+ abort op.to_s
+end
+
raise op.to_s unless options[:target]
raise op.to_s unless rest and rest.size == 1
command = rest.first
raise op.to_s unless ['deploy', 'setup'].include?(command)
ENV['to'] = options[:target]
ENV['path'] = options[:path]
ENV['only'] = options[:only]
ENV['check'] = options[:check]
+ENV['debug'] = options[:debug]
if command == 'deploy'
Rake::Task['deploy:now'].invoke
else
Rake::Task['deploy:setup'].invoke
-end
\ No newline at end of file
+end