Skip to content

Commit 015582e

Browse files
feat: apply CR suggestion
1 parent 137fcc3 commit 015582e

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

cmd/arduino-app-cli/app/clean.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,10 @@ import (
1717
func newCacheCleanCmd(cfg config.Configuration) *cobra.Command {
1818
var forceClean bool
1919
appCmd := &cobra.Command{
20-
Use: "clean-cache",
20+
Use: "clean-cache <app-id>",
2121
Short: "Delete app cache",
2222
Args: cobra.ExactArgs(1),
2323
RunE: func(cmd *cobra.Command, args []string) error {
24-
if len(args) == 0 {
25-
return cmd.Help()
26-
}
2724
app, err := Load(args[0])
2825
if err != nil {
2926
return err

internal/orchestrator/cache.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@ func CleanAppCache(
2828
return err
2929
}
3030
if runningApp.FullPath.EqualsTo(app.FullPath) {
31-
return ErrCleanCacheRunningApp
32-
}
33-
34-
if req.ForceClean && app.AppComposeFilePath().Exist() {
31+
if !req.ForceClean {
32+
return ErrCleanCacheRunningApp
33+
}
3534
// We try to remove docker related resources at best effort
3635
_ = StopAndDestroyApp(ctx, app)
3736
}

0 commit comments

Comments
 (0)