sandboxbox 2.3.9 → 2.4.0
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/package.json +1 -1
- package/test-echo/test.js +1 -0
- package/utils/isolation.js +16 -0
package/package.json
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
console.log('Hello from test project');
|
package/utils/isolation.js
CHANGED
@@ -94,6 +94,14 @@ export function createIsolatedEnvironment(projectDir) {
|
|
94
94
|
|
95
95
|
if (!existsSync(gitDirPath)) {
|
96
96
|
// Not a git repository, skip git setup
|
97
|
+
// Define cleanup function early for early return
|
98
|
+
const cleanup = () => {
|
99
|
+
try {
|
100
|
+
rmSync(tempDir, { recursive: true, force: true });
|
101
|
+
} catch (cleanupError) {
|
102
|
+
// Ignore cleanup errors
|
103
|
+
}
|
104
|
+
};
|
97
105
|
return { tempDir, tempProjectDir, cleanup };
|
98
106
|
}
|
99
107
|
|
@@ -104,6 +112,14 @@ export function createIsolatedEnvironment(projectDir) {
|
|
104
112
|
|
105
113
|
if (!existsSync(tempGitDirPath)) {
|
106
114
|
// Copy didn't preserve git, skip git setup
|
115
|
+
// Define cleanup function early for early return
|
116
|
+
const cleanup = () => {
|
117
|
+
try {
|
118
|
+
rmSync(tempDir, { recursive: true, force: true });
|
119
|
+
} catch (cleanupError) {
|
120
|
+
// Ignore cleanup errors
|
121
|
+
}
|
122
|
+
};
|
107
123
|
return { tempDir, tempProjectDir, cleanup };
|
108
124
|
}
|
109
125
|
|