Skip to content

Commit

Permalink
Add custom GitHub server handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
gdziadkiewicz committed Apr 26, 2016
1 parent 4f9cf80 commit ce46828
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@
"title": "Copy GitHub link to clipboard"
}
],
"configuration": {
"type": "object",
"title": "Open in Github extension configuration",
"properties": {
"openInGitHub.gitHubAddress": {
"type": [
"string"
],
"default": "https:\/\/github.com",
"description": "GitHub server address. Modify this setting in your workspace settings of projects using custom GitHub server"
}
}
},
"keybindings": [
{
"command": "extension.openInGitHub",
Expand Down
5 changes: 3 additions & 2 deletions src/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ function getGitHubLink(cb) {
cwd: cwd
}, function (err, config) {
var rawUri, parseOpts, lineIndex = 0, parsedUri, branch, editor, selection
, projectName, subdir, gitLink, scUrls;
, projectName, subdir, gitLink, scUrls, workspaceConfiguration;

workspaceConfiguration = VsCode.workspace.getConfiguration("openInGitHub");
scUrls = {
github: 'https://github.com',
github: workspaceConfiguration.gitHubAddress,
bitbucket: 'https://bitbucket.org',
visualstudiocom: /^https:\/\/[\w\d-]*\.visualstudio.com\//
}
Expand Down

0 comments on commit ce46828

Please sign in to comment.