dev commits.

This commit is contained in:
MasOnShi
2022-04-03 20:51:11 +08:00
parent 219e0316f5
commit 1710c83f99

View File

@@ -27,6 +27,7 @@ DOWNLOAD_LINK = {
},
}
def get_version(to_path):
package_file_path = os.path.join(to_path, "app/resources/package.json")
package_info = open(package_file_path, "r").read()
@@ -50,7 +51,7 @@ def patch_file(_key, _iv, to_dir):
if not os.path.exists(save_dir):
os.makedirs(save_dir)
subprocess.check_call(["tar", "-zxvf", exports_file_path, save_dir])
subprocess.check_call(["tar", "-zxvf", exports_file_path, "-C", save_dir])
patch_file_path = os.path.join(save_dir, "typora.py")
content = open(patch_file_path, "r").read()
content = content.replace("{AES_KEY}", f"b''.fromhex('{_key}')")