Sha256: b8021a7906d10d0bf040d1dcd6c3ba5db3ecb2f02cb237d22519c904dc3a2841

Contents?: true

Size: 651 Bytes

Versions: 23

Compression:

Stored size: 651 Bytes

Contents

command "run command" do |c|
  c.syntax = 'brief run FILE'
  c.description = 'run a script in the context of the briefcase'

  c.action do |args, options|
    command = args.first.to_s.to_sym

    bc = Brief.case
    bc = bc.call if bc.respond_to?(:call)

    if !Brief.commands[command.to_sym]
      puts "Invalid command. #{ Brief.commands.keys }"
    else
      bc.run_command(command.to_sym, *args)
    end
  end
end

command "run" do |c|
  c.syntax = 'brief run FILE'
  c.description = 'run a script in the context of the briefcase'

  c.action do |args, options|
    code = Pathname(args.first).read
    Brief.case.instance_eval(code)
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
brief-1.11.9 lib/brief/cli/run.rb
brief-1.11.8 lib/brief/cli/run.rb
brief-1.11.7 lib/brief/cli/run.rb