mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-10 02:40:26 +08:00
Log git hash if using replaced module
This commit is contained in:
parent
e79c1b7ea3
commit
cc5c7d1d29
@ -3,6 +3,7 @@
|
|||||||
package application
|
package application
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/go-git/go-git/v5"
|
||||||
"github.com/samber/lo"
|
"github.com/samber/lo"
|
||||||
"github.com/wailsapp/wails/v3/internal/commands"
|
"github.com/wailsapp/wails/v3/internal/commands"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@ -46,10 +47,17 @@ func (a *App) logStartup() {
|
|||||||
wailsVersion := commands.VersionString
|
wailsVersion := commands.VersionString
|
||||||
if wailsPackage != nil && wailsPackage.Replace != nil {
|
if wailsPackage != nil && wailsPackage.Replace != nil {
|
||||||
wailsVersion = "(local) => " + filepath.ToSlash(wailsPackage.Replace.Path)
|
wailsVersion = "(local) => " + filepath.ToSlash(wailsPackage.Replace.Path)
|
||||||
|
// Get the latest commit hash
|
||||||
|
repo, err := git.PlainOpen(filepath.Join(wailsPackage.Replace.Path, ".."))
|
||||||
|
if err == nil {
|
||||||
|
head, err := repo.Head()
|
||||||
|
if err == nil {
|
||||||
|
wailsVersion += " (" + head.Hash().String()[:8] + ")"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
args = append(args, "Wails", wailsVersion)
|
args = append(args, "Wails", wailsVersion)
|
||||||
args = append(args, "Compiler", BuildInfo.GoVersion)
|
args = append(args, "Compiler", BuildInfo.GoVersion)
|
||||||
|
|
||||||
for key, value := range BuildSettings {
|
for key, value := range BuildSettings {
|
||||||
args = append(args, key, value)
|
args = append(args, key, value)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user