Define a mechanism to load user-specific commands #62

Open
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+5 −1
Split
View
@@ -67,6 +67,10 @@ def activate(args)
Dir[BasePath + '/commands/*.rb'].each do |command|
load command
end
+ # load user local extensions
+ Dir[ENV['HOME']+ '/.github-gem/commands/*.rb'].each do |command|
+ load command
+ end
invoke(args.shift, *args)
end
@@ -146,7 +150,7 @@ def debug?
end
def load(file)
- file[0] =~ /^\// ? path = file : path = BasePath + "/commands/#{File.basename(file)}"
+ file =~ /^\// ? path = file : path = BasePath + "/commands/#{File.basename(file)}"
data = File.read(path)
GitHub.module_eval data, path
end