On 31 Jan 2009, at 06:48, Adam van den Hoven wrote:
I was talking about editing radiant directly and bending to my will
but writing a script to handle it is probably smarter.
Sigh I do hate it when lofty ideas are shot down. :)
Now if I could only bypass the interactive portions of the bootstrap.
Capistrano allows you to provide answers to interactive command line
prompts. The following code snippet demonstrates how:
yaml = load_yaml("#{current_path}/config/database.yml")['production']
sql = "mysql -u #{yaml['username']} -p #{yaml['database']} < db/
setup.sql"
run sql do |ch, stream, out|
if out =~ /^Enter password:/
ch.send_data "#{yaml['password']}\n"
puts sql
puts "#{yaml['password']}\n"
end
end
You might be able to do the same in a rake task, but I'm not too sure.
Anyway, you can use capistrano to run commands locally, not just on
remote machines.
Drew
_______________________________________________
Radiant mailing list
Post: Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant