Skip to content

Commit

Permalink
Merge pull request #105 from dlubitz/patch-1
Browse files Browse the repository at this point in the history
BUGFIX: Fix local folder structure of resources
  • Loading branch information
kdambekalns authored Dec 18, 2024
2 parents d9af8b5 + e7dfb21 commit 6087373
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/beach/cmd/resource-download.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ func handleResourceDownloadRun(cmd *cobra.Command, args []string) {
log.Error(err)
} else {
source := bucket.Object(attributes.Name)
targetPath := filepath.Dir(filepath.Join(resourcesPath, getRelativePersistentResourcePathByHash(attributes.Name)))
targetPathAndFilename := filepath.Join(resourcesPath, getRelativePersistentResourcePathByHash(attributes.Name), filepath.Base(attributes.Name))

err = os.MkdirAll(targetPath, 0755)
err = os.MkdirAll(filepath.Dir(targetPathAndFilename), 0755)
if err != nil {
log.Fatal(err)
return
}

file, err := os.OpenFile(filepath.Join(targetPath, filepath.Base(attributes.Name)), os.O_RDWR|os.O_CREATE, 0644)
file, err := os.OpenFile(targetPathAndFilename, os.O_RDWR|os.O_CREATE, 0644)
if err != nil {
log.Fatal(err)
return
Expand Down

0 comments on commit 6087373

Please sign in to comment.