introduce parameters for script

pull/1/merge
Romano Licker 12 years ago
parent 6d123432aa
commit d4f5b9fe0b
  1. 19
      setup.rb

@ -1,6 +1,7 @@
#!/usr/bin/env ruby
require 'yaml'
$parsed_options = nil
def abort_installation!
p "Something went wrong :("
@ -59,6 +60,24 @@ def check_for_db_yaml
end
end
def parse_argv(option)
return $parsed_options if $parsed_options
params_hash = {}
name = nil
ARGV.each do |param|
if param[0,2] == "--"
name = param
params_hash[name] = []
else
params_hash[name] << param
end
end
$parsed_options = params_hash[option] ? params_hash[option].inject(""){|result,a| result + a + " "} : ""
end
def checkout_default_plugins
exec_dir = Dir.pwd + "/vendor"
plugin_install_dir = Dir.pwd + "/vendor/plugins/"

Loading…
Cancel
Save