You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Checking whether or not the server.jar can be found on script startup should be essential to avoid users setting up something incorrectly and thinking their setup is working, while the script cannot find the server when a users actually tries to connect.
This should be handled with OS independent functions/libraries.
The text was updated successfully, but these errors were encountered:
I just quickly through something together because I needed this in the Docker branch for testing.
Has to be adjusted for usage of the config file and maybe cleaned up a bit.
// Check if MC server file exists at chosen location
if mcPath[len(mcPath)-1:] != "/" {
logger("Path without last \"/\". Adding...")
mcPath = mcPath + "/"
}
mcFilePath := mcPath + mcFile
logger("mcFilePath: " + mcFilePath)
if _, err := os.Stat(mcFilePath); err != nil {
if os.IsNotExist(err) {
logger("MC server file not found.")
os.Exit(1)
}
} else {
logger("MC server file found.")
}
Oh, and maybe this is Linux specific...
Gotta check the os.Stat() definition.
Also, adding / is definitely linux specific. For Windows one would need to add \
Checking whether or not the server.jar can be found on script startup should be essential to avoid users setting up something incorrectly and thinking their setup is working, while the script cannot find the server when a users actually tries to connect.
This should be handled with OS independent functions/libraries.
The text was updated successfully, but these errors were encountered: