Skip to content

Commit 35e46ee

Browse files
committed
fix: ignore empty folder errors
1 parent 8bccc83 commit 35e46ee

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

internal/handlers/compose/init.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package handlers
22

33
import (
4+
"errors"
45
"os"
56
"path/filepath"
67
"strings"
@@ -142,7 +143,9 @@ func InitHandler(isCli bool, params InitHandlerInputs) error {
142143

143144
logger.Debug("Save config to: ", outputFile)
144145
if err = config.SaveConfigTo(outputFile, false, true); err != nil {
145-
return err
146+
if !errors.Is(err, models.ErrorEmptyFolder) {
147+
return err
148+
}
146149
}
147150

148151
// Bind files

internal/handlers/compose/update.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package handlers
33
import (
44
// Common
55

6+
"errors"
67
"fmt"
78
"os"
89
"os/exec"
@@ -178,9 +179,11 @@ func UpdateHandler(params UpdateHandlerParams) error {
178179
// Save the configuration
179180
err = newConfig.SaveConfigTo(confFile, true, false)
180181
if err != nil {
181-
logger.Error(err)
182+
if !errors.Is(err, models.ErrorEmptyFolder) {
183+
logger.Error(err)
182184

183-
return err
185+
return err
186+
}
184187
}
185188

186189
// Run post-run script

0 commit comments

Comments
 (0)