5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 22:31:06 +08:00

[v2] Fix slash escaping in git username

This commit is contained in:
Lea\Anthony 2021-11-30 19:02:20 +11:00
parent b9283009df
commit 507e8d5222

View File

@ -1,7 +1,9 @@
package git
import (
"html/template"
"runtime"
"strings"
"github.com/wailsapp/wails/v2/internal/shell"
)
@ -29,7 +31,8 @@ func Email() (string, error) {
// Name tries to retrieve the
func Name() (string, error) {
stdout, _, err := shell.RunCommand(".", gitcommand(), "config", "user.name")
return stdout, err
name := template.JSEscapeString(strings.TrimSpace(stdout))
return name, err
}
func InitRepo(projectDir string) error {