Sha256: 113d9d1c9cd7ceb580bc19b20ed1584b9184bdf5ac87ea1333f9b46b5be34a82

Contents?: true

Size: 695 Bytes

Versions: 5

Compression:

Stored size: 695 Bytes

Contents

command :mv do |c|
  c.workflow :git
  c.desc "Moves a file from one place to another"
  
  c.opt :force, "Forces the move, ignoring overwrites", :short => "-f"
  c.opt :"dry-run", "Doesn't actually move files - only prints what would happen", :short => "-n"
  
  c.before do |opts, args|
    if args.size < 2
      Amp::UI.say "Usage: amp move source destination"
      c.break
    elsif args.size > 2 && !File.directory?(args.last)
      Amp::UI.say "If you want to move more than 1 file, your destination must" +
                  " be a directory."
      c.break
    end
  end
  
  c.on_run do |opts, args|
    opts.merge!(:rename => true)
    Amp::Command["copy"].run(opts, args)
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
amp-0.5.3 lib/amp/commands/commands/workflows/git/mv.rb
amp-0.5.2 lib/amp/commands/commands/workflows/git/mv.rb
amp-0.5.1 lib/amp/commands/commands/workflows/git/mv.rb
amp-pure-0.5.0 lib/amp/commands/commands/workflows/git/mv.rb
amp-0.5.0 lib/amp/commands/commands/workflows/git/mv.rb