From 603bc59a887a5bc9ef128c9da9e5db49ba83a73c Mon Sep 17 00:00:00 2001 From: kayomn Date: Tue, 20 Dec 2022 23:33:20 +0000 Subject: [PATCH] Implement clean deployment command --- main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.go b/main.go index 2cdb8ed..d20090c 100644 --- a/main.go +++ b/main.go @@ -178,6 +178,16 @@ var commands = []Command{ IsVarargs: false, Action: func(requiredArguments []string, arguments []string) (string, error) { + if len(arguments) != len(requiredArguments) { + return "", fmt.Errorf("expected %s", requiredArguments[0]) + } + + if gameError := WithGame(arguments[0], func(game *Game) error { + return game.CleanDeployedMods() + }); gameError != nil { + return "", gameError + } + return "cleaned", nil }, },