Skip to content

Commit

Permalink
fix: permission denied
Browse files Browse the repository at this point in the history
  • Loading branch information
oSethoum committed Apr 1, 2023
1 parent 5b5d447 commit 9d696e8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions cmd/entgqlplus/main.go → cmd/entgqlplus/entgqlplus.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ func main() {
Buffer: parseTemplate("generate.go.tmpl", data),
},
}
os.Mkdir("ent/schema", 0666)
os.Mkdir("ent/schema", 0777)
writeFiles(files)
}

func writeFiles(files []file) {
for _, f := range files {
err := os.MkdirAll(path.Dir(f.Path), 0666)
err := os.MkdirAll(path.Dir(f.Path), 0777)
catch(err)
os.WriteFile(f.Path, []byte(f.Buffer), 0666)
os.WriteFile(f.Path, []byte(f.Buffer), 0777)
}
}

Expand Down
2 changes: 1 addition & 1 deletion templates/upload.resolvers.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ func (r *mutationResolver) Upload(ctx context.Context, input graphql.Upload) (bo
if err != nil {
return false, err
}
err = os.WriteFile(input.Filename, out, 0666)
err = os.WriteFile(input.Filename, out, 0777)
return true, err
}
4 changes: 2 additions & 2 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ func writeFiles(files []file) {
}

func writeFile(f file) {
err := os.MkdirAll(path.Dir(f.Path), 0666)
err := os.MkdirAll(path.Dir(f.Path), 0777)
catch(err)
os.WriteFile(f.Path, []byte(f.Buffer), 0666)
os.WriteFile(f.Path, []byte(f.Buffer), 0777)
}

func readFile(filePath string) string {
Expand Down

0 comments on commit 9d696e8

Please sign in to comment.