class Dotbot::CLI

CLI for Dotty

Public Class Methods

get_config() click to toggle source
# File lib/dotbot/cli.rb, line 17
def self.get_config
  dotfile = File.join(ENV["HOME"], ".dotbot")
  if File.exist?(dotfile)
    contents = YAML.load_file(dotfile)
    Config.new(contents["dir"])
  elsif ENV["DOTBOT_DIR"]
    Config.new(ENV["DOTBOT_DIR"])
  else
    raise NoConfigError.new
  end
end
start(args) click to toggle source
Calls superclass method
# File lib/dotbot/cli.rb, line 10
def self.start(args)
  @@config = get_config
  super
rescue DotbotError => err
  exit(1)
end

Public Instance Methods

track(filepath) click to toggle source
# File lib/dotbot/cli.rb, line 31
def track(filepath)
  Dotbot::track(filepath, @@config, options[:git])
end
update() click to toggle source
# File lib/dotbot/cli.rb, line 36
def update
  Dotbot::update(@@config)
end