lib/stack/runner.rb in stack-0.0.6 vs lib/stack/runner.rb in stack-0.0.7
- old
+ new
@@ -42,19 +42,27 @@
case self.command
when /(generate|gen)/
@generator.transform!
when /(server)/
# make a watcher
- watcher = Stack::Watcher.new(@generator)
- watcher.keep_alive = false
- watcher.observe
+ if Stack::runner.configuration.server_watch
+ watcher = Stack::Watcher.new(@generator)
+ watcher.keep_alive = false
+ watcher.observe
+ end
# and a server
server = Stack::Server.new(@generator)
server.observe
when /(watch)/
# setup a watcher
watcher = Stack::Watcher.new(@generator)
watcher.observe
+ when /(create)/
+ File.open("#{Stack::runner.configuration.source}/_stack.yml", "w") { |file|
+ YAML.dump(Stack::runner.configuration.to_hash, file)
+ }
+
+ puts "Created configuration file at '#{Stack::runner.configuration.source}/_stack.yml'"
end
end
end
end
\ No newline at end of file