Skip to content

Commit

Permalink
create local sync path if it does not exist (devspace-sh#1031)
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianKramm committed Mar 27, 2020
1 parent 0b5c60d commit c63cd9d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/devspace/services/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,19 @@ func (serviceClient *client) startSyncClient(options *startClientOptions, log lo
syncConfig = options.SyncConfig
)

// check if local path exists
_, err := os.Stat(syncConfig.LocalSubPath)
if err != nil {
if !os.IsNotExist(err) {
return err
}

err = os.MkdirAll(syncConfig.LocalSubPath, 0755)
if err != nil {
return err
}
}

selector, err := targetselector.NewTargetSelector(serviceClient.config, serviceClient.client, options.SelectorParameter, options.AllowPodPick, targetselector.ImageSelectorFromConfig(syncConfig.ImageName, serviceClient.config, serviceClient.generated))
if err != nil {
return errors.Errorf("Error creating target selector: %v", err)
Expand Down

0 comments on commit c63cd9d

Please sign in to comment.