From ce4682836808036752736437b289e864a3faa9f3 Mon Sep 17 00:00:00 2001 From: Grzegorz Dziadkiewicz Date: Tue, 26 Apr 2016 10:50:19 +0200 Subject: [PATCH] Add custom GitHub server handling. --- package.json | 13 +++++++++++++ src/extension.js | 5 +++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 03d37fc..24c3355 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/extension.js b/src/extension.js index b117153..9c738a9 100644 --- a/src/extension.js +++ b/src/extension.js @@ -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\// }