-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix support for private GitHub shortcuts deps. Fix #573
- Loading branch information
1 parent
5e2fbe6
commit 5681b82
Showing
8 changed files
with
52 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,14 +35,25 @@ test('getGitHTTPUrl should return the correct git bitbucket url', () => { | |
expect(BitBucketResolver.getGitHTTPUrl(fragment)).toBe(expected); | ||
}); | ||
|
||
test('getGitHTTPUrl should return the correct git bitbucket SSH url', () => { | ||
test('getGitSSH should return the correct git bitbucket SSH url', () => { | ||
const fragment: ExplodedFragment = { | ||
user: 'foo', | ||
repo: 'bar', | ||
hash: '', | ||
}; | ||
|
||
const expected = '[email protected]:' + fragment.user + '/' + fragment.repo + '.git'; | ||
expect(BitBucketResolver.getGitSSH(fragment)).toBe(expected); | ||
}); | ||
|
||
test('getGitSSHUrl should return the correct git bitbucket SSH url', () => { | ||
const fragment: ExplodedFragment = { | ||
user: 'foo', | ||
repo: 'bar', | ||
hash: '', | ||
}; | ||
|
||
const expected = 'git+ssh://[email protected]/' + fragment.user + '/' + fragment.repo + '.git'; | ||
expect(BitBucketResolver.getGitSSHUrl(fragment)).toBe(expected); | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,10 @@ export default class BitbucketResolver extends HostedGitResolver { | |
} | ||
|
||
static getGitSSHUrl(parts: ExplodedFragment): string { | ||
return `git+ssh://[email protected]/${ parts.user }/${ parts.repo }.git`; | ||
} | ||
|
||
static getGitSSH(parts: ExplodedFragment): string { | ||
return `[email protected]:${parts.user}/${parts.repo}.git`; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,11 @@ export default class GitHubResolver extends HostedGitResolver { | |
} | ||
|
||
static getGitSSHUrl(parts: ExplodedFragment): string { | ||
return `git+ssh://[email protected]/${ parts.user }/${ parts.repo }.git` + | ||
`${parts.hash ? '#' + decodeURIComponent(parts.hash) : ''}`; | ||
} | ||
|
||
static getGitSSH(parts: ExplodedFragment): string { | ||
return `git@${this.hostname}:${parts.user}/${parts.repo}.git` + | ||
`${parts.hash ? '#' + decodeURIComponent(parts.hash) : ''}`; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,10 @@ export default class GitLabResolver extends HostedGitResolver { | |
} | ||
|
||
static getGitSSHUrl(parts: ExplodedFragment): string { | ||
return `git+ssh://[email protected]/${ parts.user }/${ parts.repo }.git`; | ||
} | ||
|
||
static getGitSSH(parts: ExplodedFragment): string { | ||
return `[email protected]:${parts.user}/${parts.repo}.git`; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters