@@ -15,7 +15,6 @@ import { hashDirectory } from "../utils/hash";
1515
1616export type BuildCommandArgs = {
1717 path : string ;
18- force ?: boolean ;
1918 ipCountry ?: string ;
2019 fromSandbox ?: string ;
2120 skipFiles ?: boolean ;
@@ -31,12 +30,6 @@ export const buildCommand: yargs.CommandModule<
3130 "Build an efficient memory snapshot from a directory. This snapshot can be used to create sandboxes quickly." ,
3231 builder : ( yargs : yargs . Argv ) =>
3332 yargs
34- . option ( "force" , {
35- alias : "f" ,
36- describe :
37- "Force the creation of a new sandbox, normally a sandbox is reused if it already exists for the given folder (if the files are the same)" ,
38- type : "boolean" ,
39- } )
4033 . option ( "ip-country" , {
4134 describe :
4235 "Cluster closest to this country to create the snapshot in, this ensures that sandboxes created of this snapshot will be created in the same cluster" ,
@@ -101,7 +94,7 @@ export const buildCommand: yargs.CommandModule<
10194 alreadyExists : true ,
10295 sandboxId : argv . fromSandbox ,
10396 }
104- : await getOrCreateSandbox ( apiClient , tag , argv . force ) ;
97+ : await createSandbox ( apiClient , tag ) ;
10598
10699 if ( alreadyExists && ! argv . fromSandbox ) {
107100 spinner . succeed ( "Sandbox snapshot has been created before:" ) ;
@@ -276,7 +269,9 @@ export const buildCommand: yargs.CommandModule<
276269
277270 spinner . succeed ( "All ports are open" ) ;
278271 } else {
279- spinner . succeed ( "No ports to open, waiting 5 seconds for tasks to run..." ) ;
272+ spinner . succeed (
273+ "No ports to open, waiting 5 seconds for tasks to run..."
274+ ) ;
280275 await new Promise ( ( resolve ) => setTimeout ( resolve , 5000 ) ) ;
281276 }
282277
@@ -297,31 +292,13 @@ export const buildCommand: yargs.CommandModule<
297292 } ,
298293} ;
299294
300- async function getOrCreateSandbox (
295+ async function createSandbox (
301296 apiClient : Client ,
302- shaTag : string ,
303- force = false
297+ shaTag : string
304298) : Promise < {
305299 alreadyExists : boolean ;
306300 sandboxId : string ;
307301} > {
308- if ( ! force ) {
309- const res = handleResponse (
310- await sandboxList ( {
311- query : {
312- page_size : 1 ,
313- tags : shaTag ,
314- } ,
315- client : apiClient ,
316- } ) ,
317- "Failed to get sandboxes from API"
318- ) ;
319-
320- if ( res . sandboxes . length > 0 ) {
321- return { alreadyExists : true , sandboxId : res . sandboxes [ 0 ] . id } ;
322- }
323- }
324-
325302 const sandbox = handleResponse (
326303 await sandboxCreate ( {
327304 client : apiClient ,
0 commit comments