@highlight-run/sourcemap-uploader
Advanced tools
Comparing version 0.0.4 to 0.0.5
25
index.js
@@ -20,2 +20,5 @@ #!/usr/bin/env node | ||
var pjson = require('./package.json'); | ||
console.log('Running version: ', pjson.version); | ||
yargs(hideBin(process.argv)) | ||
@@ -26,3 +29,3 @@ .command( | ||
() => {}, | ||
async ({ organizationId, apiKey, path, version }) => { | ||
async ({ organizationId, apiKey, path }) => { | ||
console.info(`Starting to upload source maps from ${path}`); | ||
@@ -40,12 +43,5 @@ | ||
if (!version) { | ||
version = uuidv4(); | ||
console.info( | ||
`The version was not provided, Highlight will generate a hash for you: ${version}` | ||
); | ||
} | ||
await Promise.all( | ||
fileList.map(({ path, name }) => | ||
uploadFile(organizationId, apiKey, path, name, version) | ||
uploadFile(organizationId, apiKey, path, name) | ||
) | ||
@@ -75,9 +71,2 @@ ); | ||
}) | ||
.option("version", { | ||
alias: "v", | ||
type: "string", | ||
default: "", | ||
describe: | ||
"The version of this build. This is typically a semantic version or Git hash.", | ||
}) | ||
.help("help").argv; | ||
@@ -119,3 +108,3 @@ | ||
async function uploadFile(organizationId, apiKey, filePath, fileName, version) { | ||
async function uploadFile(organizationId, apiKey, filePath, fileName) { | ||
const query = `query UploadSourceMap($apiKey: String!, $file: Upload!) { | ||
@@ -127,3 +116,3 @@ uploadSourceMap(apiKey: $apiKey, file: $file) | ||
// Setting up S3 upload parameters | ||
const bucketPath = `${organizationId}/${version}/${fileName}`; | ||
const bucketPath = `${organizationId}/${fileName}`; | ||
const params = { | ||
@@ -130,0 +119,0 @@ Bucket: BUCKET_NAME, |
{ | ||
"name": "@highlight-run/sourcemap-uploader", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Command line tool to upload source maps to Highlight", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
4521
125