Print command to shell error
This commit is contained in:
@@ -1,18 +1,16 @@
|
||||
package build_shared
|
||||
|
||||
import (
|
||||
"github.com/sagernet/sing/common"
|
||||
)
|
||||
import "github.com/sagernet/sing/common/shell"
|
||||
|
||||
func ReadTag() (string, error) {
|
||||
currentTag, err := common.Exec("git", "describe", "--tags").ReadOutput()
|
||||
currentTag, err := shell.Exec("git", "describe", "--tags").ReadOutput()
|
||||
if err != nil {
|
||||
return currentTag, err
|
||||
}
|
||||
currentTagRev, _ := common.Exec("git", "describe", "--tags", "--abbrev=0").ReadOutput()
|
||||
currentTagRev, _ := shell.Exec("git", "describe", "--tags", "--abbrev=0").ReadOutput()
|
||||
if currentTagRev == currentTag {
|
||||
return currentTag[1:], nil
|
||||
}
|
||||
shortCommit, _ := common.Exec("git", "rev-parse", "--short", "HEAD").ReadOutput()
|
||||
shortCommit, _ := shell.Exec("git", "rev-parse", "--short", "HEAD").ReadOutput()
|
||||
return currentTagRev[1:] + "-" + shortCommit, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user