mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-03 15:49:58 +08:00
[v2] Fix slash escaping in git username
This commit is contained in:
parent
b9283009df
commit
507e8d5222
@ -1,7 +1,9 @@
|
|||||||
package git
|
package git
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"html/template"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v2/internal/shell"
|
"github.com/wailsapp/wails/v2/internal/shell"
|
||||||
)
|
)
|
||||||
@ -29,7 +31,8 @@ func Email() (string, error) {
|
|||||||
// Name tries to retrieve the
|
// Name tries to retrieve the
|
||||||
func Name() (string, error) {
|
func Name() (string, error) {
|
||||||
stdout, _, err := shell.RunCommand(".", gitcommand(), "config", "user.name")
|
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 {
|
func InitRepo(projectDir string) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user