Skip to content

Commit

Permalink
feat(bundles): add new min and max options (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
robingenz authored May 4, 2024
1 parent 1eac9ac commit 41d4bad
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions src/commands/apps/bundles/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ export default defineCommand({
description: 'Create a new app bundle.',
},
args: {
path: {
androidMax: {
type: 'string',
description: 'Path to the bundle to upload. Must be a folder (e.g. `www` or `dist`) or a zip file.',
description: 'The maximum Android version code (`versionCode`) that the bundle supports.',
},
androidMin: {
type: 'string',
description: 'The minimum Android version code (`versionCode`) that the bundle supports.',
},
appId: {
type: 'string',
Expand All @@ -26,15 +30,28 @@ export default defineCommand({
type: 'string',
description: 'Channel to associate the bundle with.',
},
path: {
type: 'string',
description: 'Path to the bundle to upload. Must be a folder (e.g. `www` or `dist`) or a zip file.',
},
iosMax: {
type: 'string',
description: 'The maximum iOS bundle version (`CFBundleVersion`) that the bundle supports.',
},
iosMin: {
type: 'string',
description: 'The minimum iOS bundle version (`CFBundleVersion`) that the bundle supports.',
},
},
run: async (ctx) => {
if (!authorizationService.hasAuthorizationToken()) {
consola.error('You must be logged in to run this command.');
return;
}

let path = ctx.args.path;
const { androidMax, androidMin, iosMax, iosMin } = ctx.args;
let appId = ctx.args.appId;
let path = ctx.args.path;
let channelName = ctx.args.channel;
if (!path) {
path = await prompt('Enter the path to the app bundle:', {
Expand Down Expand Up @@ -73,6 +90,18 @@ export default defineCommand({
if (channelName) {
formData.append('channelName', channelName);
}
if (androidMax) {
formData.append('maxAndroidAppVersionCode', androidMax);
}
if (androidMin) {
formData.append('minAndroidAppVersionCode', androidMin);
}
if (iosMax) {
formData.append('maxIosAppVersionCode', iosMax);
}
if (iosMin) {
formData.append('minIosAppVersionCode', iosMin);
}
consola.start('Uploading...');
// Upload the bundle
try {
Expand Down

0 comments on commit 41d4bad

Please sign in to comment.