mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
Make sure the invoke task gives a sane error if the COMMAND value is omitted (closes #8827)
git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@7204 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
cdb38cd287
commit
d20e62155e
2 changed files with 5 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
|||
*SVN*
|
||||
|
||||
* Make sure the invoke task gives a sane error when the COMMAND value is omitted [halorgium]
|
||||
|
||||
* Make sure variables are conditionally set in the deploy recipes, so as not to clobber values set elsewhere [Jamis Buck]
|
||||
|
||||
* Fix "input stream is empty" errors from HighLine on prompt [Jamis Buck]
|
||||
|
|
|
@ -15,8 +15,10 @@ desc <<-DESC
|
|||
$ cap ROLES=app,web SUDO=1 COMMAND="tail -f /var/log/messages" invoke
|
||||
DESC
|
||||
task :invoke do
|
||||
command = ENV["COMMAND"] || ""
|
||||
abort "Please specify a command to execute on the remote servers (via the COMMAND environment variable)" if command.empty?
|
||||
method = ENV["SUDO"] ? :sudo : :run
|
||||
invoke_command(ENV["COMMAND"], :via => method)
|
||||
invoke_command(command, :via => method)
|
||||
end
|
||||
|
||||
desc <<-DESC
|
||||
|
|
Loading…
Add table
Reference in a new issue