From cd609822c8382dd50a56497340565ed2542683c4 Mon Sep 17 00:00:00 2001 From: Youssef Raafat Date: Tue, 7 Mar 2023 16:26:27 +0200 Subject: [PATCH] Replace CLI `dir` flag with `file` --- cli/UploadSourcemaps.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/cli/UploadSourcemaps.ts b/cli/UploadSourcemaps.ts index 5f86329e1..d2a9315b4 100755 --- a/cli/UploadSourcemaps.ts +++ b/cli/UploadSourcemaps.ts @@ -2,11 +2,10 @@ import axios from 'axios'; import { Command, Option } from 'commander'; import FormData from 'form-data'; import fs from 'fs'; -import path from 'path'; interface UploadSourcemapsOptions { platform: 'android' | 'ios'; - dir: string; + file: string; token: string; name: string; code: string; @@ -23,10 +22,7 @@ uploadSourcemapsCommand .makeOptionMandatory(), ) .addOption( - new Option( - '-d, --dir ', - 'The path of the directory including the source map file', - ).makeOptionMandatory(), + new Option('-f, --file ', 'The path of the source map file').makeOptionMandatory(), ) .addOption( new Option('-t, --token ', 'Your App Token') @@ -56,8 +52,7 @@ uploadSourcemapsCommand const uploadSourcemaps = async (opts: UploadSourcemapsOptions) => { const fileName = `${opts.platform}-sourcemap.json`; - const filePath = path.join(opts.dir, fileName); - const fileBlob = fs.readFileSync(filePath); + const fileBlob = fs.readFileSync(opts.file); const version = { code: opts.code,