@geode/opengeodeweb-microservice 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/generate_pyinstaller.js +13 -3
- package/package.json +1 -1
package/generate_pyinstaller.js
CHANGED
|
@@ -44,6 +44,14 @@ function createVenv() {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
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
|
+
|
|
47
55
|
function installDependecies(pythonExe) {
|
|
48
56
|
console.log(`→ Installing dependencies ...`);
|
|
49
57
|
const pipCommand = `pip install ${projectPath} pyinstaller`;
|
|
@@ -60,9 +68,10 @@ function installDependecies(pythonExe) {
|
|
|
60
68
|
|
|
61
69
|
function runPyInstaller(pythonExe) {
|
|
62
70
|
console.log(`→ Running PyInstaller ...`);
|
|
63
|
-
const specFiles = fs
|
|
64
|
-
.
|
|
65
|
-
.
|
|
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));
|
|
66
75
|
if (specFiles.length !== 1) {
|
|
67
76
|
console.error("Expected 1 spec file, found " + specFiles.length);
|
|
68
77
|
process.exit(1);
|
|
@@ -83,6 +92,7 @@ function main() {
|
|
|
83
92
|
const pythonExe = createVenv();
|
|
84
93
|
installDependecies(pythonExe);
|
|
85
94
|
runPyInstaller(pythonExe);
|
|
95
|
+
deleteVenv();
|
|
86
96
|
}
|
|
87
97
|
|
|
88
98
|
main();
|
package/package.json
CHANGED