0

more helpful error if given worlddir does not contain level.dat

This commit is contained in:
Aaron Griffith
2011-07-25 11:05:21 -04:00
parent ef6ad96080
commit 85a55c25c3

View File

@@ -176,6 +176,11 @@ def main():
parser.print_help() parser.print_help()
logging.error("Invalid world number") logging.error("Invalid world number")
sys.exit(1) sys.exit(1)
# final sanity check for worlddir
if not os.path.exists(os.path.join(worlddir, 'level.dat')):
logging.error("Invalid world path -- does not contain level.dat")
sys.exit(1)
if len(args) < 2: if len(args) < 2:
if options.delete: if options.delete: