sandboxbox 2.4.8 → 2.4.9

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sandboxbox",
3
- "version": "2.4.8",
3
+ "version": "2.4.9",
4
4
  "description": "Portable container runner with Podman - Claude Code & Playwright support. Works on Windows, macOS, and Linux.",
5
5
  "type": "module",
6
6
  "main": "cli.js",
@@ -104,14 +104,7 @@ export function runCommand(projectDir, cmd = 'bash') {
104
104
  // Actually initialize the machine instead of just waiting
105
105
  if (process.platform === 'win32') {
106
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
-
107
+ // First try to start existing machine
115
108
  console.log(color('cyan', ' Starting Podman machine...'));
116
109
  execSync(`"${podmanPath}" machine start`, {
117
110
  stdio: 'pipe',
@@ -120,10 +113,36 @@ export function runCommand(projectDir, cmd = 'bash') {
120
113
  timeout: 60000 // 1 minute for machine start
121
114
  });
122
115
 
123
- console.log(color('green', ' ✅ Podman machine ready!'));
116
+ console.log(color('green', ' ✅ Podman machine started!'));
124
117
  continue; // Try container again immediately
125
- } catch (machineError) {
126
- console.log(color('red', ` Machine setup failed: ${machineError.message}`));
118
+ } catch (startError) {
119
+ // Machine doesn't exist or failed to start, try initializing it
120
+ if (startError.message.includes('does not exist') || startError.message.includes('not found')) {
121
+ try {
122
+ console.log(color('cyan', ' Initializing new Podman machine...'));
123
+ execSync(`"${podmanPath}" machine init --rootful=false`, {
124
+ stdio: 'pipe',
125
+ shell: true,
126
+ windowsHide: true,
127
+ timeout: 180000 // 3 minutes for machine init
128
+ });
129
+
130
+ console.log(color('cyan', ' Starting new Podman machine...'));
131
+ execSync(`"${podmanPath}" machine start`, {
132
+ stdio: 'pipe',
133
+ shell: true,
134
+ windowsHide: true,
135
+ timeout: 60000 // 1 minute for machine start
136
+ });
137
+
138
+ console.log(color('green', ' ✅ Podman machine ready!'));
139
+ continue; // Try container again immediately
140
+ } catch (initError) {
141
+ console.log(color('red', ` Machine init failed: ${initError.message}`));
142
+ }
143
+ } else {
144
+ console.log(color('red', ` Machine start failed: ${startError.message}`));
145
+ }
127
146
  }
128
147
  }
129
148
 
@@ -189,14 +208,7 @@ export function shellCommand(projectDir) {
189
208
  // Actually initialize the machine instead of just waiting
190
209
  if (process.platform === 'win32') {
191
210
  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
-
211
+ // First try to start existing machine
200
212
  console.log(color('cyan', ' Starting Podman machine...'));
201
213
  execSync(`"${podmanPath}" machine start`, {
202
214
  stdio: 'pipe',
@@ -205,10 +217,36 @@ export function shellCommand(projectDir) {
205
217
  timeout: 60000 // 1 minute for machine start
206
218
  });
207
219
 
208
- console.log(color('green', ' ✅ Podman machine ready!'));
220
+ console.log(color('green', ' ✅ Podman machine started!'));
209
221
  continue; // Try container again immediately
210
- } catch (machineError) {
211
- console.log(color('red', ` Machine setup failed: ${machineError.message}`));
222
+ } catch (startError) {
223
+ // Machine doesn't exist or failed to start, try initializing it
224
+ if (startError.message.includes('does not exist') || startError.message.includes('not found')) {
225
+ try {
226
+ console.log(color('cyan', ' Initializing new Podman machine...'));
227
+ execSync(`"${podmanPath}" machine init --rootful=false`, {
228
+ stdio: 'pipe',
229
+ shell: true,
230
+ windowsHide: true,
231
+ timeout: 180000 // 3 minutes for machine init
232
+ });
233
+
234
+ console.log(color('cyan', ' Starting new Podman machine...'));
235
+ execSync(`"${podmanPath}" machine start`, {
236
+ stdio: 'pipe',
237
+ shell: true,
238
+ windowsHide: true,
239
+ timeout: 60000 // 1 minute for machine start
240
+ });
241
+
242
+ console.log(color('green', ' ✅ Podman machine ready!'));
243
+ continue; // Try container again immediately
244
+ } catch (initError) {
245
+ console.log(color('red', ` Machine init failed: ${initError.message}`));
246
+ }
247
+ } else {
248
+ console.log(color('red', ` Machine start failed: ${startError.message}`));
249
+ }
212
250
  }
213
251
  }
214
252