@capgo/cli 3.13.11 → 3.13.13

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/src/utils.ts CHANGED
@@ -243,10 +243,10 @@ export async function uploadUrl(supabase: SupabaseClient<Database>, appId: strin
243
243
  }
244
244
 
245
245
  export const updateOrCreateChannel = async (supabase: SupabaseClient<Database>,
246
- update: Database['public']['Tables']['channels']['Insert'], apikey: string) => {
246
+ update: Database['public']['Tables']['channels']['Insert']) => {
247
247
  // console.log('updateOrCreateChannel', update)
248
248
  if (!update.app_id || !update.name || !update.created_by) {
249
- console.error('missing app_id, name, or created_by')
249
+ p.log.error('missing app_id, name, or created_by')
250
250
  return Promise.reject(new Error('missing app_id, name, or created_by'))
251
251
  }
252
252
  const { data, error } = await supabase
@@ -265,6 +265,10 @@ export const updateOrCreateChannel = async (supabase: SupabaseClient<Database>,
265
265
  p.log.warn('Latest progressive deploy has not finished')
266
266
 
267
267
  update.secondVersion = update.version
268
+ if (!data.secondVersion) {
269
+ p.log.error('missing secondVersion')
270
+ return Promise.reject(new Error('missing secondVersion'))
271
+ }
268
272
  update.version = data.secondVersion
269
273
  update.secondaryVersionPercentage = 0.1
270
274
  p.log.info('Started new progressive upload!')