Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to define a Bower dependency to a Git repository with no releases tagged?

Tags:

bower

Trying to add a dependency to arbor using Bower. This JS library does not have any releases tagged in GitHub, but has been published to Bower. How should the dependency look in bower.json?

"dependencies": {
   "arbor": ...
}
like image 409
Lawrence Wagerfield Avatar asked Dec 01 '13 11:12

Lawrence Wagerfield


1 Answers

As it is written in the documentation, you can specify the package in form of a remote Git endpoint:

"dependencies": {
    "some-package": "git://github.com/someone/some-package.git"
 }

Since GitHub is usually used, there is a shortcut for this (unless specified otherwise):

"dependencies": {
    "some-package": "someone/some-package"
 }

This will download the newest version of the package. To make sure that your app will work with the downloaded version, you can specify the commit with its hash. So this

"dependencies": {
    "some-package": "someone/some-package#ddb859e7e7d2beb9c7ecd54cfe4ea2e67ac1d797"
 }

will always download the package in the state of that specific commit.

Update: Changed protocol from SSH ([email protected]:) to plain git (git://github.com/) as pointed out in the comments.

like image 125
Robin Pokorny Avatar answered Nov 10 '22 03:11

Robin Pokorny