lib/caravan.rb in caravan-0.5.1 vs lib/caravan.rb in caravan-0.5.2

- old
+ new

@@ -30,19 +30,29 @@ listener.ignore(Regexp.compile(item)) end Caravan::Message.success("Starting to watch #{src_path}...") deployer.after_create + if merged_conf["once"] + deploy_at_once(deployer) + exit(0) + end listener.start trap("INT") do listener.stop deployer.before_destroy Caravan::Message.success("\tHalting watching.") exit(0) end sleep_forever + end + + def deploy_at_once(deployer) + deployer.before_deploy + deployer.run + deployer.after_deploy end def create_listener(deployer, src_path) Listen.to(src_path) do |modified, added, removed| # rubocop:disable Lint/NonLocalExitFromIterator