我有一個Rake文件這樣耙清潔引發錯誤時,文件不存在
task :clean do
sh 'rm ./foo'
end
我想阻止它在文件「富」是不存在的錯誤報告。怎麼做?
我想我想要的是:有沒有辦法先檢查文件,然後決定下一步該做什麼。
例如:
file 'aaa' => 'bbb' do
sh 'cp bbb aaa'
end
這個任務依賴於文件 'BBB' 的存在,所以我想知道can I tell Rake that my task depends on the
不存在of file 'foo'
?
酷!學到了很多。謝謝。 – Rocky 2011-12-22 09:31:45