Added command to display current version of homesick.
This commit is contained in:
@@ -4,9 +4,11 @@ require 'thor'
|
||||
class Homesick < Thor
|
||||
autoload :Shell, 'homesick/shell'
|
||||
autoload :Actions, 'homesick/actions'
|
||||
autoload :Version, 'homesick/version'
|
||||
|
||||
include Thor::Actions
|
||||
include Homesick::Actions
|
||||
include Homesick::Version
|
||||
|
||||
add_runtime_options!
|
||||
|
||||
@@ -15,6 +17,9 @@ class Homesick < Thor
|
||||
|
||||
DEFAULT_CASTLE_NAME = 'dotfiles'
|
||||
|
||||
map '-v' => :version
|
||||
map '--version' => :version
|
||||
|
||||
def initialize(args = [], options = {}, config = {})
|
||||
super
|
||||
self.shell = Homesick::Shell.new
|
||||
@@ -264,6 +269,11 @@ class Homesick < Thor
|
||||
end
|
||||
end
|
||||
|
||||
desc 'version', 'Display the current version of homesick'
|
||||
def version
|
||||
say Homesick::Version::STRING
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def home_dir
|
||||
|
||||
10
lib/homesick/version.rb
Normal file
10
lib/homesick/version.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*- encoding : utf-8 -*-
|
||||
class Homesick
|
||||
module Version
|
||||
MAJOR = 0
|
||||
MINOR = 9
|
||||
PATCH = 8
|
||||
|
||||
STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user