File tree 4 files changed +24
-1
lines changed
4 files changed +24
-1
lines changed Original file line number Diff line number Diff line change
1
+ 1.2.0 / 2015-03-14
2
+ ==================
3
+ - provide ` getHash() ` for component-downloader and shrinkwrapper
4
+
1
5
1.1.11 / 2015-01-22
2
6
==================
3
7
- fix [ component #621 ] ( https://github.com/componentjs/component/issues/621 ) - not resolving semver in some cases
Original file line number Diff line number Diff line change @@ -28,6 +28,11 @@ function BitBucket(options) {
28
28
29
29
BitBucket . prototype . name = 'bitbucket'
30
30
31
+ BitBucket . prototype . getHash = function * ( repo , ref ) {
32
+ console . log ( 'BitBucket.prototype.getHash not implemented yet' ) ;
33
+ return null ;
34
+ } ;
35
+
31
36
/**
32
37
* DOES NOT SOLVE REDIRECTS!
33
38
*
Original file line number Diff line number Diff line change @@ -50,6 +50,20 @@ GitHub.prototype._checkRedirect = function* (repo) {
50
50
return null ;
51
51
}
52
52
53
+ GitHub . prototype . getHash = function * ( repo , ref ) {
54
+ var uri = 'https://api.github.com/repos/' + repo + '/commits?sha=' + ref ;
55
+ debug ( 'GET "%s"' , uri ) ;
56
+ API_COUNTER ++ ;
57
+ var hash = null ;
58
+ var res = yield * this . request ( uri , true ) ;
59
+ if ( res . statusCode === 404 ) {
60
+ debug ( 'could not fetch hash for ' + repo , ref ) ;
61
+ } else {
62
+ hash = res . body [ 0 ] . sha ;
63
+ }
64
+ return hash ;
65
+ } ;
66
+
53
67
/**
54
68
* @param {String } repo
55
69
* @return {Array } references
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " component-remotes" ,
3
3
"description" : " Normalize remote end points" ,
4
- "version" : " 1.1.11 " ,
4
+ "version" : " 1.2.0 " ,
5
5
"author" : {
6
6
"name" : " Jonathan Ong" ,
7
7
You can’t perform that action at this time.
0 commit comments