Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
github
hub
提交
aabc10b2
H
hub
项目概览
github
/
hub
12 个月 前同步成功
通知
3
Star
22523
Fork
2406
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hub
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
aabc10b2
编写于
11月 12, 2014
作者:
J
Jingwen Owen Ou
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #686 from github/build_version
Include git tag SHA in build
上级
96d8bfc6
6815930a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
37 addition
and
21 deletion
+37
-21
commands/version.go
commands/version.go
+1
-1
script/build
script/build
+20
-2
script/godep
script/godep
+0
-18
script/version
script/version
+16
-0
未找到文件。
commands/version.go
浏览文件 @
aabc10b2
...
...
@@ -8,7 +8,7 @@ import (
"github.com/github/hub/utils"
)
const
Version
=
"2.2.0-preview1"
var
Version
=
"2.2.0-preview1"
var
cmdVersion
=
&
Command
{
Run
:
runVersion
,
...
...
script/build
浏览文件 @
aabc10b2
...
...
@@ -5,6 +5,18 @@
set
-
e
setup_gopath
()
{
TMP_GOPATH
=
"${TMPDIR:-/tmp}/go"
TMP_SELF
=
"${TMP_GOPATH}/src/github.com/github/hub"
export
GOPATH
=
"${TMP_GOPATH}:${PWD}/Godeps/_workspace:$GOPATH"
if
[
!
-
e
"$TMP_SELF"
];
then
mkdir
-
p
"${TMP_SELF%/*}"
ln
-
snf
"$PWD"
"$TMP_SELF"
fi
}
find_source_files
()
{
find
.
-
maxdepth
2
-
name
'*.go'
-
not
-
name
'*_test.go'
"$@"
}
...
...
@@ -18,7 +30,13 @@ up_to_date() {
}
build_hub
()
{
[
-
n
"$1"
]
&&
(
up_to_date
"$1"
||
.
/
script
/
godep
go
build
-
o
"$1"
--
tags
noupdate
)
setup_gopath
[
-
n
"$1"
]
&&
(
up_to_date
"$1"
||
go
build
-
tags
"noupdate"
-
ldflags
"-X github.com/github/hub/commands.Version `./script/version`"
-
o
"$1"
)
}
test_hub
()
{
setup_gopath
go
test
.
/
...
}
case
"$1"
in
...
...
@@ -31,7 +49,7 @@ case "$1" in
build_hub
$
1
;;
test
)
.
/
script
/
godep
go
test
.
/
...
test_hub
;;
-
h
|
--
help
)
sed
-
ne
'/^#/!q;s/.\{1,2\}//;1d;p'
<
"$0"
...
...
script/godep
已删除
100755 → 0
浏览文件 @
96d8bfc6
#!/usr/bin/env bash
# Usage: script/build [test]
#
# Sets up GOPATH and run command
set
-e
TMP_GOPATH
=
"
${
TMPDIR
:-
/tmp
}
/go"
TMP_SELF
=
"
${
TMP_GOPATH
}
/src/github.com/github/hub"
export
GOPATH
=
"
${
TMP_GOPATH
}
:
${
PWD
}
/Godeps/_workspace:
$GOPATH
"
if
[
!
-e
"
$TMP_SELF
"
]
;
then
mkdir
-p
"
${
TMP_SELF
%/*
}
"
ln
-snf
"
$PWD
"
"
$TMP_SELF
"
fi
$@
script/version
0 → 100755
浏览文件 @
aabc10b2
#!/usr/bin/env ruby
# Usage: script/version
#
# Displays hub's release version
version
=
`git describe --tags HEAD 2>/dev/null`
.
chomp
version
=
if
version
.
empty?
content
=
File
.
read
(
'commands/version.go'
)
version
=
content
[
/^var Version = "(.+)"/
,
1
]
head_sha
=
`git rev-parse --short HEAD 2>/dev/null`
.
chomp
version
+=
"-g
#{
head_sha
}
"
unless
head_sha
.
empty?
version
else
version
.
sub
(
/^v/
,
''
)
end
puts
version
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录