Skip to content

Commit 6391f12

Browse files
committed
add versionnum variable
1 parent 127ca61 commit 6391f12

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

main.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,12 @@ func parseTemplate(templ string, version string) string {
198198

199199
func templateData(version string) map[string]string {
200200
return map[string]string{
201-
"Version": version,
202-
"OS": runtime.GOOS,
203-
"Arch": runtime.GOARCH,
204-
"ArchBIT": fmt.Sprintf("%d", strconv.IntSize),
205-
"FileExt": defaultFileExtension(),
201+
"Version": version,
202+
"VersionNum": strings.TrimPrefix(version, "v"),
203+
"OS": runtime.GOOS,
204+
"Arch": runtime.GOARCH,
205+
"ArchBIT": fmt.Sprintf("%d", strconv.IntSize),
206+
"FileExt": defaultFileExtension(),
206207
}
207208
}
208209

@@ -284,9 +285,8 @@ func readToolbox() (*types.Toolbox, error) {
284285
if err != nil {
285286
return nil, err
286287
}
287-
288288
homePath := filepath.Join(userHomeDir, toolboxConfFile)
289-
if _, err := os.Stat(tbFile); err == nil {
289+
if _, err := os.Stat(homePath); err == nil {
290290
tbFile = homePath
291291
}
292292
}

0 commit comments

Comments
 (0)