mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 22:55:48 +01:00
Adding name and author, also found out while trying to find options for value escaping the string conversion isnt needed :)
Signed-off-by: Snider <snider@lt.hn>
This commit is contained in:
parent
deb1156916
commit
dcef8679d2
2 changed files with 6 additions and 5 deletions
|
|
@ -1,4 +1,6 @@
|
|||
{
|
||||
"name": "{{.ProjectName}}",
|
||||
"author": "",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"install": "go install github.com/wailsapp/wails/v2/cmd/wails@latest",
|
||||
|
|
|
|||
|
|
@ -158,18 +158,17 @@ func processPackageJSON(frontendDir string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
data, err := os.ReadFile(packageJSON)
|
||||
json, err := os.ReadFile(packageJSON)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
json := string(data)
|
||||
|
||||
// We will ignore these errors - it's not critical
|
||||
println("Updating package.json data...")
|
||||
json, _ = sjson.Set(json, "name", "{{.ProjectName}}")
|
||||
json, _ = sjson.Set(json, "author", "{{.AuthorName}}")
|
||||
json, _ = sjson.SetBytes(json, "name", "{{.ProjectName}}")
|
||||
json, _ = sjson.SetBytes(json, "author", "{{.AuthorName}}")
|
||||
|
||||
err = os.WriteFile(packageJSON, []byte(json), 0644)
|
||||
err = os.WriteFile(packageJSON, json, 0644)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue