Permalink
Browse files

added a mechanism to load user-local command extensions

  • Loading branch information...
kohsuke committed Jun 29, 2011
1 parent 594ac58 commit f983fe1e2296b0bb08510914a3cebb7cae036f59
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/github.rb
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

0 comments on commit f983fe1

Please sign in to comment.