From 3ec1042ef58dbd928d9c34888182ad13037d783f Mon Sep 17 00:00:00 2001 From: Felipe M Date: Thu, 14 Jan 2021 20:32:36 +0100 Subject: [PATCH] Create folders only if there are screenshots for the game --- pkg/cli/cli.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/cli/cli.go b/pkg/cli/cli.go index 07dad15..7a9188e 100644 --- a/pkg/cli/cli.go +++ b/pkg/cli/cli.go @@ -72,6 +72,11 @@ func processGames(games []games.Game, outputPath string, dryRun bool, downloadCo destinationPath = filepath.Join(destinationPath, game.ID) } + // Do not continue if there's no screenshots + if len(game.Screenshots) == 0 { + continue + } + // Check if folder exists if _, err := os.Stat(destinationPath); os.IsNotExist(err) && !dryRun { mkdirErr := os.MkdirAll(destinationPath, 0711)