CRITICAL FIX: relative path support
parent
7959384339
commit
babf543f75
|
@ -107,10 +107,16 @@ def getToken(username, password):
|
|||
|
||||
return access_token, profile_id, username
|
||||
|
||||
def deRelative(cwd, path):
|
||||
if path[0]=='.':
|
||||
return os.path.join(cwd, path)
|
||||
else:
|
||||
return path
|
||||
|
||||
def run(java_executable, ram, alignTo, libs, username, gameDir, assets, uuid, accessToken):
|
||||
cwd = os.getcwd()
|
||||
os.chdir(gameDir)
|
||||
exitCode = os.system(java_executable+" -Xmx"+ram+alignTo+" -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M -Djava.library.path="+os.path.join(libs, "natives")+" -cp "+os.path.join(libs,"jar")+os.sep+(":"+os.path.join(libs,"jar")+os.sep).join(os.listdir(os.path.join(libs,"jar")))+" net.minecraft.launchwrapper.Launch --username "+username+" --version 1.7.10-Forge10.13.4.1614-1.7.10 --gameDir "+gameDir+" --assetsDir "+assets+" --assetIndex 1.7.10 --uuid "+str(uuid)+" --accessToken "+accessToken+" --userProperties {} --userType mojang --tweakClass cpw.mods.fml.common.launcher.FMLTweaker")
|
||||
exitCode = os.system(deRelative(cwd, java_executable)+" -Xmx"+ram+alignTo+" -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M -Djava.library.path="+os.path.join(deRelative(cwd, libs), "natives")+" -cp "+os.path.join(deRelative(cwd, libs),"jar")+os.sep+(":"+os.path.join(deRelative(cwd,libs),"jar")+os.sep).join(os.listdir(os.path.join(deRelative(cwd, libs),"jar")))+" net.minecraft.launchwrapper.Launch --username "+username+" --version 1.7.10-Forge10.13.4.1614-1.7.10 --gameDir "+deRelative(cwd,gameDir)+" --assetsDir "+deRelative(cwd, assets)+" --assetIndex 1.7.10 --uuid "+str(uuid)+" --accessToken "+accessToken+" --userProperties {} --userType mojang --tweakClass cpw.mods.fml.common.launcher.FMLTweaker")
|
||||
os.chdir(cwd)
|
||||
return exitCode
|
||||
|
||||
|
|
Reference in New Issue