Method: Parser.run

Defined in:
lib/xmk/parser.rb

.run(cmd, noprint = false) ⇒ Object



319
320
321
322
323
324
325
326
327
328
329
330
# File 'lib/xmk/parser.rb', line 319

def self.run(cmd, noprint = false)
  unless Xmk.options[:disable_cmd]
    if Xmk.options[:verbose]
      Xmk.print("execute #{cmd}")
    end
    v = %x{#{cmd}}
    return v if v.strip.empty?
    puts v unless noprint
    return v
  end
  nil
end