Renames hosting to remote

This commit is contained in:
Eric Amodio
2017-03-24 03:37:22 -04:00
parent 4d1cfd6413
commit 0feaf285cd
16 changed files with 74 additions and 69 deletions

26
src/git/remotes/github.ts Normal file
View File

@@ -0,0 +1,26 @@
'use strict';
import { RemoteProvider } from './provider';
export class GitHubService extends RemoteProvider {
constructor(public domain: string, public path: string) {
super(domain, path);
}
get name() {
return 'GitHub';
}
protected getUrlForBranch(branch: string): string {
return `${this.baseUrl}/tree/${branch}`;
}
protected getUrlForCommit(sha: string): string {
return `${this.baseUrl}/commit/${sha}`;
}
protected getUrlForFile(fileName: string, sha?: string): string {
if (sha) return `${this.baseUrl}/blob/${sha}/${fileName}`;
return `${this.baseUrl}?path=${fileName}`;
}
}