Skip to content

Commit

Permalink
switch argument "url or file" check priority
Browse files Browse the repository at this point in the history
(lazy fix for invalid path error on windows)
  • Loading branch information
nothub committed Oct 31, 2023
1 parent 04dca9b commit d9f2f24
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit d9f2f24

Please sign in to comment.