From b9e5ef8e76895a9dced0a25142cfcaa678424766 Mon Sep 17 00:00:00 2001 From: Milo Chen Date: Thu, 27 Apr 2023 05:42:39 +0800 Subject: [PATCH] Fix pynecone.json version issue when web init (#885) --- pynecone/utils/prerequisites.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pynecone/utils/prerequisites.py b/pynecone/utils/prerequisites.py index 6ef8bf465..d63888841 100644 --- a/pynecone/utils/prerequisites.py +++ b/pynecone/utils/prerequisites.py @@ -205,6 +205,12 @@ def initialize_web_directory(): path_ops.rm(os.path.join(constants.WEB_TEMPLATE_DIR, constants.NODE_MODULES)) path_ops.rm(os.path.join(constants.WEB_TEMPLATE_DIR, constants.PACKAGE_LOCK)) path_ops.cp(constants.WEB_TEMPLATE_DIR, constants.WEB_DIR) + """Write the current version of distributed pynecone package to a PCVERSION_APP_FILE.""" + with open(constants.PCVERSION_APP_FILE) as f: # type: ignore + pynecone_json = json.load(f) + pynecone_json["version"] = constants.VERSION + with open(constants.PCVERSION_APP_FILE, "w") as f: + json.dump(pynecone_json, f, ensure_ascii=False) def install_bun():