[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
+4 -1
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 {