From bd9c7b5ae9b4824185574d7a13f2a7568ad338f0 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Fri, 3 May 2019 21:19:04 -0600 Subject: [PATCH] include hash --- README.md | 2 +- src/cli/cli.go | 2 +- src/install/default.txt | 2 +- src/install/updateversion.go | 10 ++++++---- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 007a0a9e..7e563b04 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ src="https://user-images.githubusercontent.com/6550035/46709024-9b23ad00-cbf6-11e8-9fb2-ca8b20b7dbec.jpg" width="408px" border="0" alt="croc">
-Version +Version Build
 Status diff --git a/src/cli/cli.go b/src/cli/cli.go index e5bc6cf7..cf79f24b 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -27,7 +27,7 @@ func Run() (err error) { app := cli.NewApp() app.Name = "croc" if Version == "" { - Version = "v4.1.6-134-ga651297-a651297" + Version = "v6.0.0-cb69e49" } app.Version = Version app.Compiled = time.Now() diff --git a/src/install/default.txt b/src/install/default.txt index acd99db5..ec9b621d 100644 --- a/src/install/default.txt +++ b/src/install/default.txt @@ -33,7 +33,7 @@ install_croc() croc_os="unsupported" croc_arch="unknown" croc_arm="" - croc_version="4.1.6" + croc_version="6.0.0" # Termux on Android has $PREFIX set which already ends with /usr diff --git a/src/install/updateversion.go b/src/install/updateversion.go index 5cddeff9..679cfa1c 100644 --- a/src/install/updateversion.go +++ b/src/install/updateversion.go @@ -15,18 +15,20 @@ func main() { } func run() (err error) { - version, err := exec.Command("git", "describe").Output() + version, err := exec.Command("git", "describe", "--abbrev=0").Output() if err != nil { return } - versionNew := strings.TrimSpace(string(version)) - versionHash, err := exec.Command("git", "rev-parse","--short","HEAD").Output() + versionNew := strings.TrimSpace(string(version)) + versionHash, err := exec.Command("git", "rev-parse", "--short", "HEAD").Output() if err != nil { return } versionHashNew := strings.TrimSpace(string(versionHash)) + fmt.Println(versionNew) + fmt.Println(versionHashNew) - err = replaceInFile("src/cli/cli.go", `Version = "`, `"`, versionNew + "-"+ versionHashNew) + err = replaceInFile("src/cli/cli.go", `Version = "`, `"`, versionNew+"-"+versionHashNew) if err == nil { fmt.Printf("updated cli.go to version %s\n", versionNew) }