Class: Organisir::Cli
- Inherits:
-
Thor
- Object
- Thor
- Organisir::Cli
- Defined in:
- lib/organisir/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
7 8 9 |
# File 'lib/organisir/cli.rb', line 7 def self.exit_on_failure? true end |
Instance Method Details
#clean_symlinks ⇒ Object
67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/organisir/cli.rb', line 67 def clean_symlinks if [:commit] say "Preparing to remove all symlinks in 5 seconds. Cancel the command by pressing Ctrl-C" sleep(5) else say "clean_symlinks command always runs in non-commit mode. Use --commit true to remove symlinks.", :red end Organisir::Commands::CleanSymlinks.new([:source], Dir.pwd, [:commit], [:all]).clean say "Process completed" rescue Interrupt say "Exiting organisir...", :green end |
#move ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/organisir/cli.rb', line 16 def move if [:commit] say "Preparing to move files in 5 seconds. Cancel the command by pressing Ctrl-C" sleep(5) else say "move command always runs in non-commit mode. Use --commit true to permanently move files.", :red end Organisir::Commands::MoveFiles.new([:source], [:destination], Dir.pwd, [:commit]).move say "Process completed" rescue Interrupt say "Exiting organisir...", :green end |
#multi_symlink ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/organisir/cli.rb', line 50 def multi_symlink if [:commit] say "Preparing to symlink files in 5 seconds. Cancel the command by pressing Ctrl-C" sleep(5) else say "multi_symlink command always runs in non-commit mode. Use --commit true to symlink files.", :red end Organisir::Commands::MultiSymlinkFiles.new([:source], [:destination], Dir.pwd, [:commit]).link say "Process completed" rescue Interrupt say "Exiting organisir...", :green end |
#symlink ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/organisir/cli.rb', line 32 def symlink if [:commit] say "Preparing to symlink files in 5 seconds. Cancel the command by pressing Ctrl-C" sleep(5) else say "symlink command always runs in non-commit mode. Use --commit true to symlink files.", :red end Organisir::Commands::SymlinkFiles.new([:source], Dir.pwd, [:commit]).link say "Process completed" rescue Interrupt say "Exiting organisir...", :green end |