0

fixed bug that occurs when %HOME% is set on windows

This commit is contained in:
Aaron Griffith
2013-07-05 18:24:18 -04:00
parent 4f41d16e8e
commit df2c4b5f03

View File

@@ -191,7 +191,7 @@ class Textures(object):
if verbose: logging.info("Found %s in '%s'", filename, path) if verbose: logging.info("Found %s in '%s'", filename, path)
return open(path, mode) return open(path, mode)
if sys.platform == "darwin": if sys.platform.startswith("darwin"):
path = search_dir("/Applications/Minecraft") path = search_dir("/Applications/Minecraft")
if path: if path:
if verbose: logging.info("Found %s in '%s'", filename, path) if verbose: logging.info("Found %s in '%s'", filename, path)
@@ -203,12 +203,12 @@ class Textures(object):
# Find an installed minecraft client jar and look in it for the texture # Find an installed minecraft client jar and look in it for the texture
# file we need. # file we need.
versiondir = None versiondir = None
if "APPDATA" in os.environ: if "APPDATA" in os.environ and sys.platform.startswith("win"):
versiondir = os.path.join(os.environ['APPDATA'], ".minecraft", "versions") versiondir = os.path.join(os.environ['APPDATA'], ".minecraft", "versions")
if "HOME" in os.environ: if "HOME" in os.environ:
# For linux: # For linux:
versiondir = os.path.join(os.environ['HOME'], ".minecraft", "versions") versiondir = os.path.join(os.environ['HOME'], ".minecraft", "versions")
if not os.path.exists(versiondir): if not os.path.exists(versiondir) and sys.platform.startswith("darwin"):
# For Mac: # For Mac:
versiondir = os.path.join(os.environ['HOME'], "Library", versiondir = os.path.join(os.environ['HOME'], "Library",
"Application Support", "minecraft", "versions") "Application Support", "minecraft", "versions")