Sha256: 177cb64ac035a17676b403182a8145649d0d29c8c828bb6de5df05058d3b005e

Contents?: true

Size: 796 Bytes

Versions: 3

Compression:

Stored size: 796 Bytes

Contents

module Commands

  def Commands.start(options)
    if !File.exists?(OsUtil.p4d_path)
      Commands.download
    end
    Conventions.init_p4droot_dir
    spawn_p4d
  end

  def Commands.spawn_p4d
    pid = Process.spawn("#{OsUtil.p4d_path} -r #{Conventions.p4droot_dir} "+
                        "-v server=1 -L #{Conventions.p4d_log_path}")
    Process.detach(pid)
  end

  def Commands.print_start_help
    puts <<-END.gsub(/^ {6}/,'')
      p4util start

      Spawns a Perforce process in your local work/p4droot directory.

      If the Perforce executable does not exist, will download the binary first.

      Will try to set up a server log at work/server.log. It'll be fairly
      verbose by default; this is *not* intended for any kind of performance
      testing.
    END
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
p4util-0.0.3 ./lib/commands/start.rb
p4util-0.0.2 ./lib/commands/start.rb
p4util-0.0.1 ./lib/commands/start.rb