fixes
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user