Skip to content

Commit

Permalink
Merge pull request #31 from cravl-dev/fix-27
Browse files Browse the repository at this point in the history
fix: create registration file parent dirs as needed (#27)
  • Loading branch information
tobias-kuendig committed Sep 12, 2023
2 parents 8f8cbef + 967be16 commit 34d930f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@ func (k *Kernel) registerDevice(ctx context.Context) (api.Registration, error) {
if err != nil {
return registration, err
}
err = os.MkdirAll(filepath.Dir(k.config.Companion.RegistrationFile.Path), 0700)
if err != nil {
return registration, err
}
err = os.WriteFile(k.config.Companion.RegistrationFile.Path, j, 0600)
if err != nil {
return registration, err
Expand Down

0 comments on commit 34d930f

Please sign in to comment.