2013-09-05 3 views
20

È possibile includere un repository Github da un ID specifico?Pacchetto git Bower con un ID commit

Ad esempio, ho bisogno del repository angular.js con ID e12e584ca8db306dce8e0f4d3a212d77fbae966c.

È possibile?

"dependencies": 
     "angular-my-repo":"https://github.com/angular/angular.js/tree/e12e584ca8db306dce8e0f4d3a212d77fbae966c", 
     "moment": "~2.1.0" 
}, 

o qual è la sintassi corretta?

+0

L'URL sembra andare alla pagina GitHub per il commit e non il codice. Bower supporta gli endpoint locali, quindi è possibile clonare il repository, eseguire il checkout del commit desiderato e puntare Bower a tale scopo. – max

+0

scusate, ho fatto un errore. L'url corretto è https://github.com/angular/angular.js/tree/e12e584ca8db306dce8e0f4d3a212d77fbae966c – Cemo

+1

per i repository registrati, è sufficiente inserire l'id di commit anziché la versione. "" angolare ":" e12e584ca8db306dce8e0f4d3a212d77fbae966c "' –

risposta

28
bower install --save git://github.com/angular/angular.js#e12e584ca8db306dce8e0f4d3a212d77fbae966c 

o

bower install --save https://github.com/angular/angular.js.git#e12e584ca8db306dce8e0f4d3a212d77fbae966c 

vedi questa discussione

https://github.com/bower/bower/issues/856

+0

Grazie! Questo mi ha salvato il giorno! – fablexis

1

Oltre a Cemo 'risposta s, è possibile installare il pacchetto gazebo da un commit utilizzando il char' # '

cioè

bower install --save package_name#commit_sha 

es

bower install --save angular.js#e12e584ca8db306dce8e0f4d3a212d77fbae966c 

Questo aggiungerà al vostro bower.json il depndency

"angular.js":"e12e584ca8db306dce8e0f4d3a212d77fbae966c" 

Spero che questo aiuti!