Skip to content

Commit

Permalink
parent set to -1 when there is none
Browse files Browse the repository at this point in the history
Also fixed premissions creating data directory
  • Loading branch information
jfontan committed Jul 23, 2021
1 parent 92a80a0 commit cb5b4a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion server/cmd/glslsandbox/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func start() error {
return fmt.Errorf("could not read environment config: %w", err)
}

err := os.MkdirAll(filepath.Join(cfg.DataPath, "thumbs"), 0666)
err := os.MkdirAll(filepath.Join(cfg.DataPath, "thumbs"), 0770)
if err != nil {
return fmt.Errorf("could not create data directory: %w", err)
}
Expand Down
5 changes: 5 additions & 0 deletions server/store/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ func Convert(j JSONEffect) Effect {
Versions: make([]Version, 0, len(j.Versions)),
}

if e.Parent < 1 {
e.Parent = -1
e.ParentVersion = -1
}

for _, v := range j.Versions {
e.Versions = append(e.Versions, Version{
CreatedAt: v.CreatedAt.Time(),
Expand Down

0 comments on commit cb5b4a3

Please sign in to comment.