bin/marvin in Sutto-marvin-0.1.0.20081014 vs bin/marvin in Sutto-marvin-0.1.0.20081016
- old
+ new
@@ -19,11 +19,11 @@
puts "Usage: marvin create <name> - Creates a marvin directory at name or ./marvin"
puts " marvin (in a Marvin dir) - Starts it, equiv. to script/marvin"
exit
end
-if ARGV.length >= 1
+if ARGV.length >= 1 && !["start", "stop", "run", "restart"].include?(ARGV[0])
if ARGV[0].to_s.downcase != "create"
puts "'#{ARGV[0]}' isn't a valid command. - Please use #{__FILE__} --help"
exit(1)
end
if File.exist?(DEST) && File.directory?(DEST)
@@ -42,16 +42,23 @@
puts "Writing setup.rb"
copy "config/setup.rb"
puts "Copying start script - script/run"
copy "script/run"
+ copy "script/daemon-runner"
FileUtils.chmod 0755, j(DEST, "script/run")
+ FileUtils.chmod 0755, j(DEST, "script/daemon-runner")
puts "Copying example handler"
copy "handlers/hello_world.rb"
puts "Done!"
-
+elsif ARGV.length >= 1
+ if !File.exist?("script/daemon-runner")
+ puts "Woops! This isn't a marvin directory."
+ exit(1)
+ end
+ exec "script/daemon-runner #{ARGV.map {|a| a.include?(" ") ? "\"#{a}\"" : a }.join(" ")}"
else
if !File.exist?("script/run")
puts "Woops! This isn't a marvin directory."
exit(1)
end
\ No newline at end of file