Skip to content

Commit 705f07b

Browse files
committed
[UX] Make single store sync more intuitive / verbose
Signed-off-by: Ilya Eryomenko <[email protected]>
1 parent a6de8fb commit 705f07b

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

internal/action/sync.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ func (s *Action) sync(ctx context.Context, store string, isAutosync bool) error
104104
return nil
105105
}
106106

107-
out.Printf(ctx, "🚥 Syncing with all remotes ...")
107+
// check if user asked for single store/remote sync or all remote sync
108+
if store == "" {
109+
out.Printf(ctx, "🚥 Syncing with all remotes ...")
110+
}
108111

109112
numEntries := 0
110113
if l, err := s.Store.Tree(ctx); err == nil {
@@ -118,6 +121,7 @@ func (s *Action) sync(ctx context.Context, store string, isAutosync bool) error
118121
// sync all stores (root and all mounted sub stores).
119122
for _, mp := range mps {
120123
if store != "" {
124+
out.Printf(ctx, "🚥 Syncing with store/remote %q...", store)
121125
if store != "<root>" && mp != store {
122126
continue
123127
}
@@ -129,7 +133,12 @@ func (s *Action) sync(ctx context.Context, store string, isAutosync bool) error
129133
numMPs++
130134
_ = s.syncMount(ctx, mp, isAutosync)
131135
}
132-
out.OKf(ctx, "All done")
136+
137+
if numMPs > 0 {
138+
out.OKf(ctx, "All done")
139+
} else {
140+
out.Printf(ctx, "⚠️ No remotes were found")
141+
}
133142

134143
// If we just sync'ed all stores we can reset the auto-sync interval
135144
if store == "" {

0 commit comments

Comments
 (0)