Skip to content

Commit 6efd582

Browse files
3cpiarna
authored andcommitted
fix(github tarball): update github tarballtemplate
The old tarball url generates a 302 redirect to https://codeload.github.com, it's troublesome for tools (like curl) which do not automatically follow redirect response. Fixes: #34 Credit: @huochunpeng
1 parent cd2c54f commit 6efd582

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

git-host-info.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var gitHosts = module.exports = {
1010
'filetemplate': 'https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}',
1111
'bugstemplate': 'https://{domain}/{user}/{project}/issues',
1212
'gittemplate': 'git://{auth@}{domain}/{user}/{project}.git{#committish}',
13-
'tarballtemplate': 'https://{domain}/{user}/{project}/archive/{committish}.tar.gz'
13+
'tarballtemplate': 'https://codeload.{domain}/{user}/{project}/tar.gz/{committish}'
1414
},
1515
bitbucket: {
1616
'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ],

test/github.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ test('fromUrl(github url)', function (t) {
1919
t.is(hostinfo.sshurl(), 'git+ssh://[email protected]/111/222.git' + hash, label + ' -> sshurl')
2020
t.is(hostinfo.shortcut(), 'github:111/222' + hash, label + ' -> shortcut')
2121
t.is(hostinfo.file('C'), 'https://raw.githubusercontent.com/111/222/' + (branch || 'master') + '/C', label + ' -> file')
22-
t.is(hostinfo.tarball(), 'https://github.com/111/222/archive/' + (branch || 'master') + '.tar.gz', label + ' -> tarball')
22+
t.is(hostinfo.tarball(), 'https://codeload.github.com/111/222/tar.gz/' + (branch || 'master'), label + ' -> tarball')
2323
}
2424

2525
// github shorturls

0 commit comments

Comments
 (0)