import { Command, Option } from 'commander'; import { uploadSourcemaps, UploadSourcemapsOptions } from '../upload/uploadSourcemaps'; export const uploadSourcemapsCommand = new Command(); uploadSourcemapsCommand .name('upload-sourcemaps') .addOption( new Option('-p, --platform ', 'Platform') .choices(['ios', 'android']) .makeOptionMandatory(), ) .addOption( new Option('-f, --file ', 'The path of the source map file').makeOptionMandatory(), ) .addOption( new Option('-t, --token ', 'Your App Token') .env('INSTABUG_APP_TOKEN') .makeOptionMandatory(), ) .addOption( new Option('-n, --name ', 'The app version name') .env('INSTABUG_APP_VERSION_NAME') .makeOptionMandatory(), ) .addOption( new Option('-c, --code ', 'The app version code') .env('INSTABUG_APP_VERSION_CODE') .makeOptionMandatory(), ) .addOption( new Option('-l, --label ', "The CodePush label if it's a CodePush release").env( 'INSTABUG_APP_VERSION_LABEL', ), ) .action(function (this: Command) { const options = this.opts(); uploadSourcemaps(options); }) .showHelpAfterError();