sandboxbox 2.4.9 → 2.5.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/utils/commands/container.js +26 -6
package/package.json
CHANGED
|
@@ -86,12 +86,20 @@ export function runCommand(projectDir, cmd = 'bash') {
|
|
|
86
86
|
while (retries < maxRetries) {
|
|
87
87
|
try {
|
|
88
88
|
// Try container operation first
|
|
89
|
-
|
|
90
|
-
stdio: 'inherit',
|
|
89
|
+
const containerOptions = {
|
|
90
|
+
stdio: process.platform === 'win32' ? ['pipe', 'pipe', 'pipe'] : 'inherit',
|
|
91
91
|
shell: process.platform === 'win32',
|
|
92
92
|
windowsHide: process.platform === 'win32',
|
|
93
93
|
timeout: 30000 // 30 second timeout
|
|
94
|
-
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
// For echo command, use non-interactive mode
|
|
97
|
+
if (cmd === 'echo' || cmd.startsWith('echo ')) {
|
|
98
|
+
const echoCmd = cmd.replace('echo ', '');
|
|
99
|
+
execSync(`"${podmanPath}" run --rm ${mounts.join(' ')} -w /workspace sandboxbox:latest echo ${echoCmd}`, containerOptions);
|
|
100
|
+
} else {
|
|
101
|
+
execSync(`"${podmanPath}" run --rm -it ${mounts.join(' ')} -w /workspace sandboxbox:latest ${cmd}`, containerOptions);
|
|
102
|
+
}
|
|
95
103
|
|
|
96
104
|
cleanup();
|
|
97
105
|
console.log(color('green', '\n✅ Container execution completed! (Isolated - no host changes)'));
|
|
@@ -114,7 +122,13 @@ export function runCommand(projectDir, cmd = 'bash') {
|
|
|
114
122
|
});
|
|
115
123
|
|
|
116
124
|
console.log(color('green', ' ✅ Podman machine started!'));
|
|
117
|
-
|
|
125
|
+
// Wait a bit more for machine to be fully ready
|
|
126
|
+
console.log(color('cyan', ' Waiting 5 seconds for machine to fully initialize...'));
|
|
127
|
+
const readyStart = Date.now();
|
|
128
|
+
while (Date.now() - readyStart < 5000) {
|
|
129
|
+
// Wait 5 seconds
|
|
130
|
+
}
|
|
131
|
+
continue; // Try container again
|
|
118
132
|
} catch (startError) {
|
|
119
133
|
// Machine doesn't exist or failed to start, try initializing it
|
|
120
134
|
if (startError.message.includes('does not exist') || startError.message.includes('not found')) {
|
|
@@ -192,7 +206,7 @@ export function shellCommand(projectDir) {
|
|
|
192
206
|
while (retries < maxRetries) {
|
|
193
207
|
try {
|
|
194
208
|
execSync(`"${podmanPath}" run --rm -it ${mounts.join(' ')} -w /workspace sandboxbox:latest /bin/bash`, {
|
|
195
|
-
stdio: 'inherit',
|
|
209
|
+
stdio: process.platform === 'win32' ? ['pipe', 'pipe', 'pipe'] : 'inherit',
|
|
196
210
|
shell: process.platform === 'win32',
|
|
197
211
|
windowsHide: process.platform === 'win32',
|
|
198
212
|
timeout: 30000 // 30 second timeout
|
|
@@ -218,7 +232,13 @@ export function shellCommand(projectDir) {
|
|
|
218
232
|
});
|
|
219
233
|
|
|
220
234
|
console.log(color('green', ' ✅ Podman machine started!'));
|
|
221
|
-
|
|
235
|
+
// Wait a bit more for machine to be fully ready
|
|
236
|
+
console.log(color('cyan', ' Waiting 5 seconds for machine to fully initialize...'));
|
|
237
|
+
const readyStart = Date.now();
|
|
238
|
+
while (Date.now() - readyStart < 5000) {
|
|
239
|
+
// Wait 5 seconds
|
|
240
|
+
}
|
|
241
|
+
continue; // Try container again
|
|
222
242
|
} catch (startError) {
|
|
223
243
|
// Machine doesn't exist or failed to start, try initializing it
|
|
224
244
|
if (startError.message.includes('does not exist') || startError.message.includes('not found')) {
|