@capgo/cli 0.13.12 → 0.14.0

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/bin/upload.ts CHANGED
@@ -3,6 +3,7 @@ import { program } from 'commander';
3
3
  import { randomUUID } from 'crypto';
4
4
  import cliProgress from 'cli-progress';
5
5
  import semver from 'semver'
6
+ import { checksum as getChecksum } from '@tomasklaen/checksum';
6
7
  import {
7
8
  host, hostWeb, getConfig, createSupabaseClient,
8
9
  updateOrCreateChannel, updateOrCreateVersion, formatError, findSavedKey, checkPlan, checkKey
@@ -97,10 +98,12 @@ export const uploadVersion = async (appid: string, options: Options) => {
97
98
  }
98
99
  b1.increment();
99
100
  const fileName = randomUUID()
101
+ let checksum = ''
100
102
  if (!external) {
101
103
  const zip = new AdmZip();
102
104
  zip.addLocalFolder(path);
103
105
  const zipped = zip.toBuffer();
106
+ checksum = await getChecksum(zipped, 'crc32');
104
107
  const mbSize = Math.floor(zipped.byteLength / 1024 / 1024);
105
108
  const filePath = `apps/${userId}/${appid}/versions`
106
109
  b1.increment();
@@ -132,6 +135,7 @@ export const uploadVersion = async (appid: string, options: Options) => {
132
135
  name: version,
133
136
  app_id: appid,
134
137
  external_url: external,
138
+ checksum,
135
139
  }, apikey)
136
140
  if (dbError) {
137
141
  multibar.stop()