Created
January 3, 2016 11:02
-
-
Save MrPowerGamerBR/0eb29756ccdb55946f58 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import zipfile | |
| import os; | |
| for allFilesJar in os.listdir(os.path.dirname(os.path.realpath(__file__))): | |
| if allFilesJar.endswith(".jar"): | |
| print allFilesJar; | |
| archive = zipfile.ZipFile(allFilesJar) | |
| for file in archive.namelist(): | |
| if file.startswith('config'): | |
| if not os.path.exists(os.path.splitext(allFilesJar)[0]): | |
| os.makedirs(os.path.splitext(allFilesJar)[0]) | |
| archive.extract(file, os.path.dirname(os.path.realpath(__file__)) + "/" + os.path.splitext(allFilesJar)[0]) | |
| os.rename(os.path.dirname(os.path.realpath(__file__)) + "/" + os.path.splitext(allFilesJar)[0] + "/" + file, os.path.dirname(os.path.realpath(__file__)) + "/" + os.path.splitext(allFilesJar)[0] + "/config.yml") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment