Sha256: 94a2e5439d1b13c1889236639c1c92f9dfc9a75c564074aeafe2007f1a5dce6c

Contents?: true

Size: 407 Bytes

Versions: 13

Compression:

Stored size: 407 Bytes

Contents

require 'warp/dir/command'

class Warp::Dir::Command::Add < Warp::Dir::Command
  description %q(Adds the current directory as a new Warp Point)
  needs_a_point? true
  aliases :new, :save, :store

  def run(*args)
    self.point_path ||= Dir.pwd
    store.insert point_name: point_name, point_path: point_path, overwrite: config.force

    on :success do
      message 'Warp point saved!'
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
warp-dir-1.7.0 lib/warp/dir/command/add.rb
warp-dir-1.6.2 lib/warp/dir/command/add.rb
warp-dir-1.6.1 lib/warp/dir/command/add.rb
warp-dir-1.6.0 lib/warp/dir/command/add.rb
warp-dir-1.5.0 lib/warp/dir/command/add.rb
warp-dir-1.3.0 lib/warp/dir/command/add.rb
warp-dir-1.2.0 lib/warp/dir/command/add.rb
warp-dir-1.1.5 lib/warp/dir/command/add.rb
warp-dir-1.1.4 lib/warp/dir/command/add.rb
warp-dir-1.1.3 lib/warp/dir/command/add.rb
warp-dir-1.1.2 lib/warp/dir/command/add.rb
warp-dir-1.1.1 lib/warp/dir/command/add.rb
warp-dir-1.1.0 lib/warp/dir/command/add.rb