feat(ST2.GitPackages): bump up all packages
- Refresh PackageCache with latest versions of everything
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"default_remote": "origin"
|
||||
}
|
||||
"default_remote": "origin",
|
||||
"default_host": "github.com"
|
||||
}
|
||||
|
@@ -21,10 +21,11 @@ The plugin should be picked up automatically. If not, restart Sublime Text.
|
||||
|
||||
## Configuration
|
||||
|
||||
The defaults should work for most setups, but if you have a different remote name, you can configure it in the `Githubinator.sublime-settings` file:
|
||||
The defaults should work for most setups, but if you have a different remote name or use GitHub Enterprise, you can configure remote and host in the `Githubinator.sublime-settings` file:
|
||||
|
||||
{
|
||||
"default_remote": "origin"
|
||||
"default_remote": "origin",
|
||||
"default_host": "github.com"
|
||||
}
|
||||
|
||||
|
||||
|
@@ -11,7 +11,14 @@ class GithubinatorCommand(sublime_plugin.TextCommand):
|
||||
|
||||
def load_config(self):
|
||||
s = sublime.load_settings("Githubinator.sublime-settings")
|
||||
global DEFAULT_GIT_REMOTE; DEFAULT_GIT_REMOTE = s.get("default_remote")
|
||||
global DEFAULT_GIT_REMOTE, DEFAULT_GITHUB_HOST
|
||||
DEFAULT_GIT_REMOTE = s.get("default_remote")
|
||||
if not isinstance(DEFAULT_GIT_REMOTE, list):
|
||||
DEFAULT_GIT_REMOTE = [DEFAULT_GIT_REMOTE]
|
||||
DEFAULT_GITHUB_HOST = s.get("default_host")
|
||||
if DEFAULT_GITHUB_HOST is None:
|
||||
DEFAULT_GITHUB_HOST = "github.com"
|
||||
|
||||
|
||||
def run(self, edit, permalink = False, mode = 'blob'):
|
||||
self.load_config()
|
||||
@@ -41,8 +48,9 @@ class GithubinatorCommand(sublime_plugin.TextCommand):
|
||||
else:
|
||||
lines = '%s-%s' % (begin_line, end_line)
|
||||
|
||||
for remote in [DEFAULT_GIT_REMOTE]:
|
||||
regex = r'.*\s.*(?:https://github\.com/|github\.com:|git://github\.com/)(.*)/(.*?)(?:\.git)?\r?\n'
|
||||
re_host = re.escape(DEFAULT_GITHUB_HOST)
|
||||
for remote in DEFAULT_GIT_REMOTE:
|
||||
regex = r'.*\s.*(?:https://%s/|%s:|git://%s/)(.*)/(.*?)(?:\.git)?\r?\n' % (re_host, re_host, re_host)
|
||||
result = re.search(remote + regex, config)
|
||||
if not result:
|
||||
continue
|
||||
@@ -53,8 +61,8 @@ class GithubinatorCommand(sublime_plugin.TextCommand):
|
||||
sha = open(os.path.join(git_path, '.git', ref_path), "r").read()[:-1]
|
||||
target = sha if permalink else branch
|
||||
|
||||
full_link = 'https://github.com/%s/%s/%s/%s%s/%s#L%s' % \
|
||||
(matches[0], matches[1], mode, target, new_git_path, file_name, lines)
|
||||
full_link = 'https://%s/%s/%s/%s/%s%s/%s#L%s' % \
|
||||
(DEFAULT_GITHUB_HOST, matches[0], matches[1], mode, target, new_git_path, file_name, lines)
|
||||
sublime.set_clipboard(full_link)
|
||||
sublime.status_message('Copied %s to clipboard.' % full_link)
|
||||
print('Copied %s to clipboard.' % full_link)
|
||||
@@ -73,4 +81,7 @@ class GithubinatorCommand(sublime_plugin.TextCommand):
|
||||
|
||||
|
||||
def is_enabled(self):
|
||||
return self.view.file_name() and len(self.view.file_name()) > 0
|
||||
if self.view.file_name() and len(self.view.file_name()) > 0:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
@@ -1 +1 @@
|
||||
{"url": "https://github.com/ehamiter/ST2-GitHubinator", "version": "2013.03.02.08.48.58", "description": "Sublime Text 2 plugin that shows selected ST2 text on GitHub"}
|
||||
{"url": "https://github.com/ehamiter/ST2-GitHubinator", "version": "2013.09.09.18.14.32", "description": "Sublime Text 2 plugin that shows selected ST2 text on GitHub"}
|
Reference in New Issue
Block a user