From 47d946765ac9b7cdb9865eafeb1b01082ed52e2e Mon Sep 17 00:00:00 2001 From: rgthree Date: Tue, 5 Dec 2023 20:25:58 -0500 Subject: [PATCH] Update Dev script for web subdir --- __dev__.py | 46 +++++++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/__dev__.py b/__dev__.py index be96c4d..2d7d92f 100644 --- a/__dev__.py +++ b/__dev__.py @@ -1,25 +1,21 @@ -import subprocess -import os -import shutil -import glob -import json - -from config import RGTHREE_CONFIG - -THIS_DIR=os.path.dirname(os.path.abspath(__file__)) -DIR_DEV=os.path.abspath(f'{THIS_DIR}/web') -DIR_WEB=os.path.abspath(f'{THIS_DIR}/../../web/extensions/rgthree-comfy') - -js_files = glob.glob(os.path.join(THIS_DIR, 'web/**/*.js')) -for file in js_files: - os.remove(file) - -subprocess.run(["./node_modules/typescript/bin/tsc"]) - - -if os.path.exists(DIR_WEB): - shutil.rmtree(DIR_WEB) -shutil.copytree(DIR_DEV, DIR_WEB, dirs_exist_ok=True) - -with open(os.path.join(DIR_WEB, 'rgthree_config.js'), 'w', encoding = 'UTF-8') as file: - file.write('export const rgthreeConfig = ' + json.dumps(RGTHREE_CONFIG)) +#!/usr/bin/env python3 + +import subprocess +import os +import shutil +import glob +import json + +from config import RGTHREE_CONFIG + +THIS_DIR=os.path.dirname(os.path.abspath(__file__)) +DIR_WEB = os.path.abspath(f'{THIS_DIR}/web/') + +js_files = glob.glob(os.path.join(THIS_DIR, 'web/**/*.js')) +for file in js_files: + os.remove(file) + +subprocess.run(["./node_modules/typescript/bin/tsc"]) + +with open(os.path.join(DIR_WEB, 'rgthree_config.js'), 'w', encoding = 'UTF-8') as file: + file.write('export const rgthreeConfig = ' + json.dumps(RGTHREE_CONFIG))