Class: DevOops::Commands::RemoveScript

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/dev_oops/commands/remove_script.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details



17
18
19
# File 'lib/dev_oops/commands/remove_script.rb', line 17

def self.banner
  "#{$PROGRAM_NAME} rm SCRIPT_NAME"
end

.source_rootObject



7
8
9
# File 'lib/dev_oops/commands/remove_script.rb', line 7

def self.source_root
  "#{File.dirname(__FILE__)}/../../../"
end

Instance Method Details

#remove_jsonObject



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/dev_oops/commands/remove_script.rb', line 21

def remove_json
  script_dir =
    if options[:global]
      ScriptsLoader::GLOBAL_DIR
    else
      ScriptsLoader.script_dir(script_name)
    end
  json_path = "#{script_dir}/#{script_name}.json"
  sh_path = "#{script_dir}/#{script_name}.sh"
  remove_file json_path if File.exist?(json_path)
  remove_file sh_path if File.exist?(sh_path)
end