Skip to content

Commit 09d648f

Browse files
authored
Merge pull request #23 from Geode-solutions/fix/delete_microservices_folders
fix(PythonVenv): delete venv for pyinstaller symlinks
2 parents 397c132 + edc5703 commit 09d648f

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

generate_pyinstaller.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ function createVenv() {
4444
}
4545
}
4646

47+
function deleteVenv() {
48+
const venvPath = path.join(projectPath, "venv");
49+
if (fs.existsSync(venvPath)) {
50+
console.log(`→ Removing virtual environment → ${venvPath}`);
51+
fs.rmSync(venvPath, { recursive: true, force: true });
52+
}
53+
}
54+
4755
function installDependecies(pythonExe) {
4856
console.log(`→ Installing dependencies ...`);
4957
const pipCommand = `pip install ${projectPath} pyinstaller`;
@@ -60,9 +68,10 @@ function installDependecies(pythonExe) {
6068

6169
function runPyInstaller(pythonExe) {
6270
console.log(`→ Running PyInstaller ...`);
63-
const specFiles = fs.readdirSync(projectPath, { withFileTypes: true })
64-
.filter(file => file.isFile() && file.name.endsWith(".spec"))
65-
.map(file => path.join(projectPath, file.name));
71+
const specFiles = fs
72+
.readdirSync(projectPath, { withFileTypes: true })
73+
.filter((file) => file.isFile() && file.name.endsWith(".spec"))
74+
.map((file) => path.join(projectPath, file.name));
6675
if (specFiles.length !== 1) {
6776
console.error("Expected 1 spec file, found " + specFiles.length);
6877
process.exit(1);
@@ -83,6 +92,7 @@ function main() {
8392
const pythonExe = createVenv();
8493
installDependecies(pythonExe);
8594
runPyInstaller(pythonExe);
95+
deleteVenv();
8696
}
8797

8898
main();

0 commit comments

Comments
 (0)