Only remove js directories if they exist.

This commit is contained in:
rgthree
2023-09-13 21:44:01 -04:00
parent 1d0f553315
commit 92160cf524
+4 -3
View File
@@ -6,10 +6,11 @@ THIS_DIR=os.path.dirname(os.path.abspath(__file__))
DIR_DEV_JS=os.path.abspath(f'{THIS_DIR}/js')
DIR_WEB_JS=os.path.abspath(f'{THIS_DIR}/../../web/extensions/rgthree')
shutil.rmtree(DIR_DEV_JS)
if os.path.exists(DIR_DEV_JS):
shutil.rmtree(DIR_DEV_JS)
subprocess.run(["./node_modules/typescript/bin/tsc"])
shutil.rmtree(DIR_WEB_JS)
if os.path.exists(DIR_WEB_JS):
shutil.rmtree(DIR_WEB_JS)
shutil.copytree(DIR_DEV_JS, DIR_WEB_JS, dirs_exist_ok=True)