lib/conf/argv.rb in rsence-pre-2.1.0.14 vs lib/conf/argv.rb in rsence-pre-2.1.0.15
- old
+ new
@@ -49,14 +49,14 @@
# Makes various commands available depending on the platform.
# The status/start/stop/restart/save -commands depend on an operating
# system that fully implements POSIX standard signals.
# These are necessary to send signals to the background process.
if not RSence.pid_support?
- @@cmds = [ :run, :initenv, :version, :help ]
+ @@cmds = [ :run, :init, :initenv, :version, :help ]
else
@@cmds = [ :run, :status, :start, :stop, :restart, :save,
- :initenv, :version, :help ]
+ :init, :initenv, :version, :help ]
end
help_avail_cmds = @@cmds.map{|cmd|cmd.to_s}.join("\n ")
# Load the strings from the strings file.
@@ -722,14 +722,17 @@
plugins_dir = File.expand_path( 'plugins', env_dir )
Dir.mkdir( plugins_dir )
run_dir = File.expand_path( 'run', env_dir )
Dir.mkdir( run_dir )
unless create_blank
- welcome_plugin_dir = File.join( SERVER_PATH, 'setup', 'welcome' )
- welcome_plugin_dst = File.join( plugins_dir, 'welcome' )
- puts ERB.new( @@strs[:initenv][:installing_welcome_plugin] ).result( binding )
- FileUtils.cp_r( welcome_plugin_dir, welcome_plugin_dst )
+ print @@strs[:initenv][:install_welcome]
+ if yesno(true)
+ welcome_plugin_dir = File.join( SERVER_PATH, 'setup', 'welcome' )
+ welcome_plugin_dst = File.join( plugins_dir, 'welcome' )
+ puts ERB.new( @@strs[:initenv][:installing_welcome_plugin] ).result( binding )
+ FileUtils.cp_r( welcome_plugin_dir, welcome_plugin_dst )
+ end
end
puts @@strs[:initenv][:creating_files]
conf_file = File.join( conf_dir, 'config.yaml' )
File.open( conf_file, 'w' ) {|f| f.write( YAML.dump( config ) ) }
readme_file = File.join( env_dir, 'README' )
@@ -787,10 +790,10 @@
parse_startup_argv
elsif cmd == :status
parse_status_argv
elsif cmd == :save
parse_save_argv
- elsif cmd == :initenv
+ elsif cmd == :initenv or cmd == :init
parse_initenv_argv
end
else
puts @@strs[:help][:unknown] + cmd.to_s.inspect
puts @@strs[:help][:help_help]