sandboxbox 2.4.7 → 2.4.8
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 +61 -2
package/package.json
CHANGED
|
@@ -85,6 +85,7 @@ export function runCommand(projectDir, cmd = 'bash') {
|
|
|
85
85
|
|
|
86
86
|
while (retries < maxRetries) {
|
|
87
87
|
try {
|
|
88
|
+
// Try container operation first
|
|
88
89
|
execSync(`"${podmanPath}" run --rm -it ${mounts.join(' ')} -w /workspace sandboxbox:latest ${cmd}`, {
|
|
89
90
|
stdio: 'inherit',
|
|
90
91
|
shell: process.platform === 'win32',
|
|
@@ -98,7 +99,36 @@ export function runCommand(projectDir, cmd = 'bash') {
|
|
|
98
99
|
} catch (error) {
|
|
99
100
|
retries++;
|
|
100
101
|
if (retries < maxRetries && (error.message.includes('Cannot connect to Podman') || error.message.includes('connectex') || error.message.includes('No connection could be made') || error.message.includes('actively refused') || error.message.includes('Command failed'))) {
|
|
101
|
-
console.log(color('yellow', ` Backend not ready yet (${retries}/${maxRetries}),
|
|
102
|
+
console.log(color('yellow', ` Backend not ready yet (${retries}/${maxRetries}), initializing machine...`));
|
|
103
|
+
|
|
104
|
+
// Actually initialize the machine instead of just waiting
|
|
105
|
+
if (process.platform === 'win32') {
|
|
106
|
+
try {
|
|
107
|
+
console.log(color('cyan', ' Initializing Podman machine...'));
|
|
108
|
+
execSync(`"${podmanPath}" machine init --rootful=false`, {
|
|
109
|
+
stdio: 'pipe',
|
|
110
|
+
shell: true,
|
|
111
|
+
windowsHide: true,
|
|
112
|
+
timeout: 180000 // 3 minutes for machine init
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
console.log(color('cyan', ' Starting Podman machine...'));
|
|
116
|
+
execSync(`"${podmanPath}" machine start`, {
|
|
117
|
+
stdio: 'pipe',
|
|
118
|
+
shell: true,
|
|
119
|
+
windowsHide: true,
|
|
120
|
+
timeout: 60000 // 1 minute for machine start
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
console.log(color('green', ' ✅ Podman machine ready!'));
|
|
124
|
+
continue; // Try container again immediately
|
|
125
|
+
} catch (machineError) {
|
|
126
|
+
console.log(color('red', ` Machine setup failed: ${machineError.message}`));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// If machine setup failed or not Windows, wait and retry
|
|
131
|
+
console.log(color('yellow', ` Waiting 15 seconds before retry...`));
|
|
102
132
|
const start = Date.now();
|
|
103
133
|
while (Date.now() - start < 15000) {
|
|
104
134
|
// Wait 15 seconds
|
|
@@ -154,7 +184,36 @@ export function shellCommand(projectDir) {
|
|
|
154
184
|
} catch (error) {
|
|
155
185
|
retries++;
|
|
156
186
|
if (retries < maxRetries && (error.message.includes('Cannot connect to Podman') || error.message.includes('connectex') || error.message.includes('No connection could be made') || error.message.includes('actively refused') || error.message.includes('Command failed'))) {
|
|
157
|
-
console.log(color('yellow', ` Backend not ready yet (${retries}/${maxRetries}),
|
|
187
|
+
console.log(color('yellow', ` Backend not ready yet (${retries}/${maxRetries}), initializing machine...`));
|
|
188
|
+
|
|
189
|
+
// Actually initialize the machine instead of just waiting
|
|
190
|
+
if (process.platform === 'win32') {
|
|
191
|
+
try {
|
|
192
|
+
console.log(color('cyan', ' Initializing Podman machine...'));
|
|
193
|
+
execSync(`"${podmanPath}" machine init --rootful=false`, {
|
|
194
|
+
stdio: 'pipe',
|
|
195
|
+
shell: true,
|
|
196
|
+
windowsHide: true,
|
|
197
|
+
timeout: 180000 // 3 minutes for machine init
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
console.log(color('cyan', ' Starting Podman machine...'));
|
|
201
|
+
execSync(`"${podmanPath}" machine start`, {
|
|
202
|
+
stdio: 'pipe',
|
|
203
|
+
shell: true,
|
|
204
|
+
windowsHide: true,
|
|
205
|
+
timeout: 60000 // 1 minute for machine start
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
console.log(color('green', ' ✅ Podman machine ready!'));
|
|
209
|
+
continue; // Try container again immediately
|
|
210
|
+
} catch (machineError) {
|
|
211
|
+
console.log(color('red', ` Machine setup failed: ${machineError.message}`));
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// If machine setup failed or not Windows, wait and retry
|
|
216
|
+
console.log(color('yellow', ` Waiting 15 seconds before retry...`));
|
|
158
217
|
const start = Date.now();
|
|
159
218
|
while (Date.now() - start < 15000) {
|
|
160
219
|
// Wait 15 seconds
|