Adds GitLab remote link support

Adds Bitbucket remote link support
Adds Visual Studio Team Services remote link support
This commit is contained in:
Eric Amodio
2017-03-28 01:28:03 -04:00
parent ab417eadbe
commit 851522f593
5 changed files with 80 additions and 3 deletions

View File

@@ -0,0 +1,27 @@
'use strict';
import { RemoteProvider } from './provider';
export class VisualStudioService extends RemoteProvider {
constructor(public domain: string, public path: string) {
super(domain, path);
}
get name() {
return 'Visual Studio Team Services';
}
protected getUrlForBranch(branch: string): string {
return `${this.baseUrl}/?version=GB${branch}&_a=history`;
}
protected getUrlForCommit(sha: string): string {
return `${this.baseUrl}/commit/${sha}`;
}
protected getUrlForFile(fileName: string, branch?: string, sha?: string): string {
if (sha) return `${this.baseUrl}/commit/${sha}/?_a=contents&path=%2F${fileName}`;
if (branch) return `${this.baseUrl}/?path=%2F${fileName}&version=GB${branch}&_a=contents`;
return `${this.baseUrl}?path=%2F${fileName}`;
}
}