如何为没有标记版本的Git仓库定义Bower依赖关系? [英] How to define a Bower dependency to a Git repository with no releases tagged?

查看:53
本文介绍了如何为没有标记版本的Git仓库定义Bower依赖关系?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用Bower向 arbor 添加依赖项。该JS库在GitHub中没有标记任何版本,但已发布到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": ...
}


推荐答案

文档中所述,您可以以远程Git的形式指定软件包端点:

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"
 }

由于通常使用GitHub,因此存在快捷方式(除非另有指定):

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.

更新::将协议从SSH( git@github.com:)更改为纯git( git://github.com/ ),如注释中所指出。

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

这篇关于如何为没有标记版本的Git仓库定义Bower依赖关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆