Remove pynecone.json from templates (#888)
This commit is contained in:
parent
a165d745f2
commit
7f5b172002
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "0.1.25"
|
|
||||||
}
|
|
@ -57,8 +57,6 @@ SITEMAP_CONFIG_FILE = os.path.join(WEB_DIR, "next-sitemap.config.js")
|
|||||||
NODE_MODULES = "node_modules"
|
NODE_MODULES = "node_modules"
|
||||||
# The package lock file.
|
# The package lock file.
|
||||||
PACKAGE_LOCK = "package-lock.json"
|
PACKAGE_LOCK = "package-lock.json"
|
||||||
# The pcversion template file.
|
|
||||||
PCVERSION_TEMPLATE_FILE = os.path.join(WEB_TEMPLATE_DIR, "pynecone.json")
|
|
||||||
# The pcversion app file.
|
# The pcversion app file.
|
||||||
PCVERSION_APP_FILE = os.path.join(WEB_DIR, "pynecone.json")
|
PCVERSION_APP_FILE = os.path.join(WEB_DIR, "pynecone.json")
|
||||||
|
|
||||||
|
@ -205,7 +205,8 @@ 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.NODE_MODULES))
|
||||||
path_ops.rm(os.path.join(constants.WEB_TEMPLATE_DIR, constants.PACKAGE_LOCK))
|
path_ops.rm(os.path.join(constants.WEB_TEMPLATE_DIR, constants.PACKAGE_LOCK))
|
||||||
path_ops.cp(constants.WEB_TEMPLATE_DIR, constants.WEB_DIR)
|
path_ops.cp(constants.WEB_TEMPLATE_DIR, constants.WEB_DIR)
|
||||||
"""Write the current version of distributed pynecone package to a PCVERSION_APP_FILE."""
|
|
||||||
|
# Write the current version of distributed pynecone package to a PCVERSION_APP_FILE."""
|
||||||
with open(constants.PCVERSION_APP_FILE) as f: # type: ignore
|
with open(constants.PCVERSION_APP_FILE) as f: # type: ignore
|
||||||
pynecone_json = json.load(f)
|
pynecone_json = json.load(f)
|
||||||
pynecone_json["version"] = constants.VERSION
|
pynecone_json["version"] = constants.VERSION
|
||||||
@ -298,10 +299,8 @@ def is_latest_template() -> bool:
|
|||||||
Returns:
|
Returns:
|
||||||
Whether the app is using the latest template.
|
Whether the app is using the latest template.
|
||||||
"""
|
"""
|
||||||
with open(constants.PCVERSION_TEMPLATE_FILE) as f: # type: ignore
|
|
||||||
template_version = json.load(f)["version"]
|
|
||||||
if not os.path.exists(constants.PCVERSION_APP_FILE):
|
if not os.path.exists(constants.PCVERSION_APP_FILE):
|
||||||
return False
|
return False
|
||||||
with open(constants.PCVERSION_APP_FILE) as f: # type: ignore
|
with open(constants.PCVERSION_APP_FILE) as f: # type: ignore
|
||||||
app_version = json.load(f)["version"]
|
app_version = json.load(f)["version"]
|
||||||
return app_version >= template_version
|
return app_version == constants.VERSION
|
||||||
|
Loading…
Reference in New Issue
Block a user