Skip to content

Commit e01f0da

Browse files
committed
normalize windows input path
1 parent 16fd7b8 commit e01f0da

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

cmd/root.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"log"
1414
"os"
1515
"path/filepath"
16+
"runtime"
1617
"strings"
1718
)
1819

@@ -68,6 +69,12 @@ func init() {
6869
}
6970
serverDir = absServerDir
7071

72+
if runtime.GOOS == "windows" {
73+
// normalize lower case windows path
74+
// e.g. c:\MCServers to C:\MCServers
75+
serverDir = strings.ToUpper(serverDir[0:1]) + serverDir[1:]
76+
}
77+
7178
// -- server-file
7279
serverFile = strings.TrimSpace(serverFile)
7380
if serverFile != "" && serverFile != filepath.Base(serverFile) {
@@ -186,8 +193,11 @@ func handleArgs(input string, version string, serverDir string, host string) (*m
186193
archivePath = file
187194

188195
} else if files.IsFile(input) {
189-
log.Printf("Installing from mrpack file: %s", input)
190196
archivePath = input
197+
if runtime.GOOS == "windows" {
198+
archivePath = strings.ToUpper(archivePath[0:1]) + archivePath[1:]
199+
}
200+
log.Printf("Installing from mrpack file: %s\n", archivePath)
191201

192202
} else {
193203
log.Printf("Trying to resolve project id or slug: %s\n", input)

0 commit comments

Comments
 (0)