0
0
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 13:21:00 +02:00

include hash

This commit is contained in:
Zack Scholl 2019-05-03 21:19:04 -06:00
parent cb69e49283
commit bd9c7b5ae9
4 changed files with 9 additions and 7 deletions

View file

@ -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()

View file

@ -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

View file

@ -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)
}