Skip to content

Commit

Permalink
fix locking in test
Browse files Browse the repository at this point in the history
  • Loading branch information
garethgeorge committed Oct 13, 2024
1 parent f501b67 commit 0f51f45
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/resticinstaller/resticinstaller.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ func FindOrInstallResticBinary() (string, error) {
resticInstallPath, _ = filepath.Abs(path.Join(path.Dir(os.Args[0]), resticBinName))
}

if err := os.MkdirAll(path.Dir(resticInstallPath), 0700); err != nil {
return "", fmt.Errorf("create restic install directory %v: %w", path.Dir(resticInstallPath), err)
}

// Install restic if not found.
if _, err := os.Stat(resticInstallPath); err != nil {
if !errors.Is(err, os.ErrNotExist) {
Expand Down

0 comments on commit 0f51f45

Please sign in to comment.