Skip to content

Commit 5195ddb

Browse files
committed
feat: add --wait flag
1 parent 00ba0ac commit 5195ddb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cmd/sync.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"github.com/loft-sh/devspace/pkg/devspace/plugin"
1111
"github.com/loft-sh/devspace/pkg/devspace/upgrade"
1212
"github.com/loft-sh/devspace/pkg/util/message"
13-
"github.com/loft-sh/devspace/pkg/util/ptr"
1413
"k8s.io/apimachinery/pkg/labels"
1514

1615
"github.com/loft-sh/devspace/cmd/flags"
@@ -33,6 +32,7 @@ type SyncCmd struct {
3332
Container string
3433
Pod string
3534
Pick bool
35+
Wait bool
3636

3737
Exclude []string
3838
ContainerPath string
@@ -99,6 +99,8 @@ devspace sync --container-path=/my-path
9999
syncCmd.Flags().BoolVar(&cmd.UploadOnly, "upload-only", false, "If set DevSpace will only upload files")
100100
syncCmd.Flags().BoolVar(&cmd.DownloadOnly, "download-only", false, "If set DevSpace will only download files")
101101

102+
syncCmd.Flags().BoolVar(&cmd.Wait, "wait", true, "Wait for the pod(s) to start if they are not running")
103+
102104
return syncCmd
103105
}
104106

@@ -186,7 +188,8 @@ func (cmd *SyncCmd) Run(f factory.Factory) error {
186188

187189
// set image selector
188190
options.ImageSelector = imageSelector
189-
options.Wait = ptr.Bool(false)
191+
options.Wait = &cmd.Wait
192+
190193
if cmd.DownloadOnly && cmd.UploadOnly {
191194
return errors.New("--upload-only cannot be used together with --download-only")
192195
}

0 commit comments

Comments
 (0)