From d9f2f244ff38c78890936732b742680c84d9ab14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20H=C3=BCbner?= Date: Wed, 1 Nov 2023 00:03:58 +0100 Subject: [PATCH] switch argument "url or file" check priority (lazy fix for invalid path error on windows) --- cmd/root.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 9718942..8c8d95f 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -106,10 +106,7 @@ var rootCmd = &cobra.Command{ } archivePath := "" - if util.PathIsFile(input) { - archivePath = input - - } else if util.IsValidUrl(input) { + if util.IsValidUrl(input) { fmt.Println("Downloading mrpack file from", args) file, err := requester.DefaultHttpClient.DownloadFile(input, serverDir, "") if err != nil { @@ -123,6 +120,9 @@ var rootCmd = &cobra.Command{ } }(archivePath) + } else if util.PathIsFile(input) { + archivePath = input + } else { // input is project id or slug? versions, err := modrinth.NewClient(host).GetProjectVersions(input, nil) if err != nil {