mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
include hash in version
This commit is contained in:
parent
a6512975ff
commit
cb69e49283
4 changed files with 10 additions and 5 deletions
|
@ -27,7 +27,7 @@ func Run() (err error) {
|
|||
app := cli.NewApp()
|
||||
app.Name = "croc"
|
||||
if Version == "" {
|
||||
Version = "v6.0.0"
|
||||
Version = "v4.1.6-134-ga651297-a651297"
|
||||
}
|
||||
app.Version = Version
|
||||
app.Compiled = time.Now()
|
||||
|
|
|
@ -33,7 +33,7 @@ install_croc()
|
|||
croc_os="unsupported"
|
||||
croc_arch="unknown"
|
||||
croc_arm=""
|
||||
croc_version="6.0.0"
|
||||
croc_version="4.1.6"
|
||||
|
||||
|
||||
# Termux on Android has $PREFIX set which already ends with /usr
|
||||
|
|
|
@ -19,9 +19,14 @@ func run() (err error) {
|
|||
if err != nil {
|
||||
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 {
|
||||
fmt.Printf("updated cli.go to version %s\n", versionNew)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue