From 8368883ca3c280d0e6b3b2b69c12ab76edead1fc Mon Sep 17 00:00:00 2001 From: yum Date: Thu, 24 Jul 2025 16:40:16 -0700 Subject: Enforce clean venv on build --- ui/build_scripts/setup-empty-venv.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'ui/build_scripts') diff --git a/ui/build_scripts/setup-empty-venv.js b/ui/build_scripts/setup-empty-venv.js index 0691a51..5322ad9 100644 --- a/ui/build_scripts/setup-empty-venv.js +++ b/ui/build_scripts/setup-empty-venv.js @@ -8,12 +8,21 @@ const dllPath = path.join(projectRoot, 'dll_empty'); console.log('Creating empty virtual environment and dll directory...'); -// Create empty dll directory -if (!fs.existsSync(dllPath)) { - fs.mkdirSync(dllPath, { recursive: true }); - console.log('Created empty dll directory'); +// Delete dll & venv if they already exist +if (fs.existsSync(dllPath)) { + fs.rmSync(dllPath, { recursive: true, force: true }); + console.log('Deleted existing dll directory'); } +if (fs.existsSync(venvPath)) { + fs.rmSync(venvPath, { recursive: true, force: true }); + console.log('Deleted existing venv directory'); +} + +// Create empty dll folder +fs.mkdirSync(dllPath, { recursive: true }); +console.log('Created empty dll directory'); +// Create hermitic python venv try { console.log('Creating new venv...'); execSync(`python -m venv "${venvPath}"`, { stdio: 'inherit' }); -- cgit v1.2.3