Class: Command::Clone

Inherits:
Object
  • Object
show all
Defined in:
lib/diskman/commands/clone.rb

Instance Method Summary collapse

Instance Method Details

#run(file:) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/diskman/commands/clone.rb', line 3

def run(file:)
    if File.exist?(file)
        puts ('File exists: ' + file).red
        raise Interrupt
    end

    device = RootDevice.choose
    cmd = device.get_clone_command(file)

    puts "File:    #{file.yellow}"
    puts "Device:  #{device.to_s.yellow}"
    puts "Command: #{cmd.yellow}"

    System.exec!(cmd)
end