mirror of https://gitee.com/answerdev/answer.git
fix(plugin): remove quotation mark about version and add default revision
This commit is contained in:
parent
b4ae373309
commit
d538b531bd
|
@ -23,9 +23,9 @@ var (
|
|||
// Version is the version of the project
|
||||
Version = "0.0.0"
|
||||
// Revision is the git short commit revision number
|
||||
Revision = ""
|
||||
Revision = "-"
|
||||
// Time is the build time of the project
|
||||
Time = ""
|
||||
Time = "-"
|
||||
// log level
|
||||
logLevel = os.Getenv("LOG_LEVEL")
|
||||
// log path
|
||||
|
|
|
@ -192,7 +192,7 @@ func copyDirEntries(sourceFs embed.FS, sourceDir string, targetDir string) (err
|
|||
func buildBinary(b *buildingMaterial) (err error) {
|
||||
versionInfo := b.originalAnswerInfo
|
||||
cmdPkg := "github.com/answerdev/answer/cmd"
|
||||
ldflags := fmt.Sprintf("-X %s.Version='%s' -X %s.Revision='%s' -X %s.Time='%s'",
|
||||
ldflags := fmt.Sprintf("-X %s.Version=%s -X %s.Revision=%s -X %s.Time=%s",
|
||||
cmdPkg, versionInfo.Version, cmdPkg, versionInfo.Revision, cmdPkg, versionInfo.Time)
|
||||
err = b.newExecCmd("go", "build",
|
||||
"-ldflags", ldflags, "-o", b.outputPath, ".").Run()
|
||||
|
|
Loading…
Reference in New Issue