This commit is contained in:
2025-09-02 19:21:03 +02:00
parent 7bf88d9d8c
commit fdc019a200
9 changed files with 94 additions and 15 deletions

View File

@@ -252,6 +252,12 @@ func (l Service) PullCurrent(id, path string, cli *client.Client) error {
return fmt.Errorf("failed to open blob from local repository: %w", err)
}
if _, err := os.Stat(path); err == nil {
if err := os.RemoveAll(path); err != nil {
return fmt.Errorf("failed to clean the destination directory: %w", err)
}
}
if err := os.MkdirAll(path, 0740); err != nil {
return fmt.Errorf("failed to create destination directory: %w", err)
}