# channel: the SSH channel object used for this response
# stream: either :err or :out, for stderr or stdout responses
# output: the text that the server is sending, might be in chunks
run "apt-get update" do |channel, stream, output|
if output =~ /Are you sure?/
answer = Capistrano::CLI.ui.ask("Are you sure: ")
channel.send_data(answer + "\n")
else
# allow the default callback to be processed
Capistrano::Configuration.default_io_proc.call[channel, stream,
output]
end
endHopefully that gives you some other ideas, too. - Jamis On Dec 13, 2007, at 11:51 PM, Scott wrote:
Without going into the wisdom of doing this (or actually in fact answering your question), you can add -y to the apt-get command, which will answer yes for you without the prompt. On Dec 13, 3:26 pm, samg <[EMAIL PROTECTED]> wrote:I wrote a task that runs apt-get update, but when it asks whether I want to proceed and presents me with a yes or no answer, i dont know how to proceed. I'm looking at Capistrano.ui.ask, which points to the highline library. Has anyone figured out how to have a cap script present you with a prompt when the shell asks you a question?--~--~---------~--~----~------------~-------~--~----~ To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/capistrano -~----------~----~----~----~------~----~------~--~---
smime.p7s
Description: S/MIME cryptographic signature
