Class: Vagrant::Node::NodeServerStart

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-node/nodeserverstart.rb

Instance Method Summary collapse

Instance Method Details

#executeObject

Raises:

  • (Vagrant::Errors::CLIInvalidUsage)


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/vagrant-node/nodeserverstart.rb', line 6

def execute
 #FIXME EVLUAR SI MERECE LA PENA EL PASAR LA PASS POR LINEA DE COMANDOS
  # options = {}
  # options[:password]= ""
    
  opts = OptionParser.new do |opts|
    opts.banner = "Usage: vagrant nodeserver start [port=3333] -p password"
    opts.separator ""
    # opts.on("-p", "--passwd password", String, "Node Password") do |b|
          # options[:password] = b
    # end
  end        

  raise Errors::NoEnvironmentError if !@env.root_path

  argv = parse_options(opts)
  return if !argv  
  raise Vagrant::Errors::CLIInvalidUsage, :help => opts.help.chomp if argv.length > 1
  		
begin                        
#ServerAPI::ServerManager.run(File.dirname(@env.lock_path),@env.data_dir,@env,argv[0].to_i)       
   ServerAPI::ServerManager.run(@env.tmp_path,@env.data_dir,@env,argv[0].to_i)       
			rescue Exception => e  
    @env.ui.error(e.message)
  end 

  0
end