mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
get version from env varaible
This commit is contained in:
parent
900424ca66
commit
11efb6be5e
1 changed files with 2 additions and 5 deletions
|
@ -3,6 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
@ -15,11 +16,7 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func run() (err error) {
|
func run() (err error) {
|
||||||
version, err := exec.Command("git", "describe", "--abbrev=0").Output()
|
versionNew := os.Getenv("VERSION")
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
versionNew := strings.TrimSpace(string(version))
|
|
||||||
versionHash, err := exec.Command("git", "rev-parse", "--short", "HEAD").Output()
|
versionHash, err := exec.Command("git", "rev-parse", "--short", "HEAD").Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue