mirror of https://github.com/schollz/croc.git
include hash in version
This commit is contained in:
parent
a6512975ff
commit
cb69e49283
|
@ -4,7 +4,7 @@
|
||||||
src="https://user-images.githubusercontent.com/6550035/46709024-9b23ad00-cbf6-11e8-9fb2-ca8b20b7dbec.jpg"
|
src="https://user-images.githubusercontent.com/6550035/46709024-9b23ad00-cbf6-11e8-9fb2-ca8b20b7dbec.jpg"
|
||||||
width="408px" border="0" alt="croc">
|
width="408px" border="0" alt="croc">
|
||||||
<br>
|
<br>
|
||||||
<a href="https://github.com/schollz/croc/releases/latest"><img src="https://img.shields.io/badge/version-v6.0.0-brightgreen.svg?style=flat-square" alt="Version"></a>
|
<a href="https://github.com/schollz/croc/releases/latest"><img src="https://img.shields.io/badge/version-v4.1.6-brightgreen.svg?style=flat-square" alt="Version"></a>
|
||||||
<a href="https://travis-ci.org/schollz/croc"><img
|
<a href="https://travis-ci.org/schollz/croc"><img
|
||||||
src="https://img.shields.io/travis/schollz/croc.svg?style=flat-square" alt="Build
|
src="https://img.shields.io/travis/schollz/croc.svg?style=flat-square" alt="Build
|
||||||
Status"></a>
|
Status"></a>
|
||||||
|
|
|
@ -27,7 +27,7 @@ func Run() (err error) {
|
||||||
app := cli.NewApp()
|
app := cli.NewApp()
|
||||||
app.Name = "croc"
|
app.Name = "croc"
|
||||||
if Version == "" {
|
if Version == "" {
|
||||||
Version = "v6.0.0"
|
Version = "v4.1.6-134-ga651297-a651297"
|
||||||
}
|
}
|
||||||
app.Version = Version
|
app.Version = Version
|
||||||
app.Compiled = time.Now()
|
app.Compiled = time.Now()
|
||||||
|
|
|
@ -33,7 +33,7 @@ install_croc()
|
||||||
croc_os="unsupported"
|
croc_os="unsupported"
|
||||||
croc_arch="unknown"
|
croc_arch="unknown"
|
||||||
croc_arm=""
|
croc_arm=""
|
||||||
croc_version="6.0.0"
|
croc_version="4.1.6"
|
||||||
|
|
||||||
|
|
||||||
# Termux on Android has $PREFIX set which already ends with /usr
|
# Termux on Android has $PREFIX set which already ends with /usr
|
||||||
|
|
|
@ -20,8 +20,13 @@ func run() (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
versionNew := strings.TrimSpace(string(version))
|
versionNew := strings.TrimSpace(string(version))
|
||||||
|
versionHash, err := exec.Command("git", "rev-parse","--short","HEAD").Output()
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
versionHashNew := strings.TrimSpace(string(versionHash))
|
||||||
|
|
||||||
err = replaceInFile("src/cli/cli.go", `Version = "`, `"`, versionNew)
|
err = replaceInFile("src/cli/cli.go", `Version = "`, `"`, versionNew + "-"+ versionHashNew)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
fmt.Printf("updated cli.go to version %s\n", versionNew)
|
fmt.Printf("updated cli.go to version %s\n", versionNew)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue