forked from twpayne/chezmoi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Populate VERSIONINFO on Windows builds
- Loading branch information
1 parent
6b82c37
commit b5fe4e2
Showing
5 changed files
with
72 additions
and
2 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{{- $name := "chezmoi" -}} | ||
{{- $filename := printf "%s.exe" $name -}} | ||
|
||
{{- /* Get the current year using the Magical Reference Date format */ -}} | ||
{{- $currentYear := now | date "2006" -}} | ||
|
||
{{- $commitHash := output "git" "rev-parse" "HEAD" | trim -}} | ||
{{- if ne "" (output "git" "diff" "--stat" | trim) -}} | ||
{{- $commitHash = printf "%s-dirty" $commitHash -}} | ||
{{- end -}} | ||
|
||
{{- $version := semver (output "git" "describe" "--abbrev=0" "--tags" | trim) -}} | ||
{{- $versionDict := (dict | ||
"Major" $version.Major | ||
"Minor" $version.Minor | ||
"Patch" $version.Patch | ||
"Build" 0) | ||
-}} | ||
|
||
{{- dict | ||
"FixedFileInfo" (dict | ||
"FileVersion" $versionDict | ||
"ProductVersion" $versionDict) | ||
"StringFileInfo" (dict | ||
"Comments" (printf "commit: %s" $commitHash) | ||
"FileDescription" "Manage your dotfiles across multiple diverse machines, securely." | ||
"FileVersion" $version.Original | ||
"InternalName" $filename | ||
"LegalCopyright" (printf "Copyright (c) 2018-%s Tom Payne" $currentYear) | ||
"OriginalFilename" $filename | ||
"ProductName" $name | ||
"ProductVersion" $version.Original) | ||
| toPrettyJson | ||
-}} |
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