Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Define a mechanism to load user-specific commands #62

Open
wants to merge 1 commit into from

1 participant

@kohsuke

Some of the commands that I want only make sense in the context of a specific project, and I'd like to keep those in my home directory. This change enables commands to be defined in ~/.github-gem/commands/*.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 29, 2011
  1. @kohsuke
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/github.rb
View
6 lib/github.rb
@@ -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
Something went wrong with that request. Please try again.