-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
77e3f2d
commit 4f4a815
Showing
9 changed files
with
59 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +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").Read() | ||
currentTag, err := shell.Exec("git", "describe", "--tags").Read() | ||
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.