@@ -2323,15 +2323,15 @@ export async function initApp(apikeyCommand: string, appId: string, options: Sup
23232323
23242324 let stepToSkip = await readStepsDone ( orgId , options . apikey ) ?? 0
23252325 if ( pendingOnboardingSelection . reusedPendingApp ) {
2326- stepToSkip = Math . max ( stepToSkip , 2 )
2326+ stepToSkip = Math . max ( stepToSkip , 1 )
23272327 }
23282328 let pkgVersion = getBundleVersion ( undefined , globalPathToPackageJson ) || '1.0.0'
23292329 let delta = globalDelta
23302330 let currentVersion = globalCurrentVersion || pkgVersion
23312331 let channelName = globalChannelName
23322332 let platform : 'ios' | 'android' = globalPlatform
23332333
2334- if ( globalCurrentVersion && stepToSkip >= 4 ) {
2334+ if ( globalCurrentVersion && stepToSkip >= 3 ) {
23352335 pkgVersion = globalCurrentVersion
23362336 }
23372337
@@ -2347,88 +2347,83 @@ export async function initApp(apikeyCommand: string, appId: string, options: Sup
23472347 if ( stepToSkip < 1 ) {
23482348 renderCurrentStep ( 1 )
23492349 await checkPrerequisitesStep ( orgId , options . apikey )
2350+ appId = await addAppStep ( organization , options . apikey , appId , options )
23502351 markStepDone ( 1 )
23512352 }
23522353
23532354 if ( stepToSkip < 2 ) {
23542355 renderCurrentStep ( 2 )
2355- appId = await addAppStep ( organization , options . apikey , appId , options )
2356- markStepDone ( 2 )
2357- }
2358-
2359- if ( stepToSkip < 3 ) {
2360- renderCurrentStep ( 3 )
23612356 channelName = await addChannelStep ( orgId , options . apikey , appId )
23622357 globalChannelName = channelName
2363- markStepDone ( 3 , undefined , channelName )
2358+ markStepDone ( 2 , undefined , channelName )
23642359 }
23652360
2366- if ( stepToSkip < 4 ) {
2367- renderCurrentStep ( 4 )
2361+ if ( stepToSkip < 3 ) {
2362+ renderCurrentStep ( 3 )
23682363 const res = await addUpdaterStep ( orgId , options . apikey , appId )
23692364 pkgVersion = res . pkgVersion
23702365 currentVersion = pkgVersion
23712366 delta = res . delta
23722367 globalCurrentVersion = currentVersion
23732368 globalDelta = delta
2369+ markStepDone ( 3 )
2370+ }
2371+
2372+ if ( stepToSkip < 4 ) {
2373+ renderCurrentStep ( 4 )
2374+ await addCodeStep ( orgId , options . apikey , appId )
23742375 markStepDone ( 4 )
23752376 }
23762377
23772378 if ( stepToSkip < 5 ) {
23782379 renderCurrentStep ( 5 )
2379- await addCodeStep ( orgId , options . apikey , appId )
2380+ await addEncryptionStep ( orgId , options . apikey , appId )
23802381 markStepDone ( 5 )
23812382 }
23822383
23832384 if ( stepToSkip < 6 ) {
23842385 renderCurrentStep ( 6 )
2385- await addEncryptionStep ( orgId , options . apikey , appId )
2386+ platform = await selectPlatformStep ( orgId , options . apikey )
2387+ globalPlatform = platform
23862388 markStepDone ( 6 )
23872389 }
23882390
23892391 if ( stepToSkip < 7 ) {
23902392 renderCurrentStep ( 7 )
2391- platform = await selectPlatformStep ( orgId , options . apikey )
2392- globalPlatform = platform
2393+ await buildProjectStep ( orgId , options . apikey , appId , platform )
23932394 markStepDone ( 7 )
23942395 }
23952396
23962397 if ( stepToSkip < 8 ) {
23972398 renderCurrentStep ( 8 )
2398- await buildProjectStep ( orgId , options . apikey , appId , platform )
2399+ await runDeviceStep ( orgId , options . apikey , appId , platform )
23992400 markStepDone ( 8 )
24002401 }
24012402
24022403 if ( stepToSkip < 9 ) {
24032404 renderCurrentStep ( 9 )
2404- await runDeviceStep ( orgId , options . apikey , appId , platform )
2405+ currentVersion = await addCodeChangeStep ( orgId , options . apikey , appId , pkgVersion , platform )
2406+ globalCurrentVersion = currentVersion
24052407 markStepDone ( 9 )
24062408 }
24072409
24082410 if ( stepToSkip < 10 ) {
24092411 renderCurrentStep ( 10 )
2410- currentVersion = await addCodeChangeStep ( orgId , options . apikey , appId , pkgVersion , platform )
2411- globalCurrentVersion = currentVersion
2412+ await uploadStep ( orgId , options . apikey , appId , currentVersion , delta )
24122413 markStepDone ( 10 )
24132414 }
24142415
24152416 if ( stepToSkip < 11 ) {
24162417 renderCurrentStep ( 11 )
2417- await uploadStep ( orgId , options . apikey , appId , currentVersion , delta )
2418+ await testCapgoUpdateStep ( orgId , options . apikey , appId , localConfig . hostWeb , delta )
24182419 markStepDone ( 11 )
24192420 }
24202421
24212422 if ( stepToSkip < 12 ) {
24222423 renderCurrentStep ( 12 )
2423- await testCapgoUpdateStep ( orgId , options . apikey , appId , localConfig . hostWeb , delta )
24242424 markStepDone ( 12 )
24252425 }
24262426
2427- if ( stepToSkip < 13 ) {
2428- renderCurrentStep ( 13 )
2429- markStepDone ( 13 )
2430- }
2431-
24322427 await markStep ( orgId , options . apikey , 'done' , appId )
24332428 cleanupStepsDone ( )
24342429 }
0 commit comments