Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bundles): add new min and max options #1

Merged
merged 1 commit into from
May 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading