From 0c14c3cc7fc8b57ec2e56f75fc0284071e0dff98 Mon Sep 17 00:00:00 2001 From: Cory Rivera Date: Mon, 22 Jan 2018 16:02:57 -0800 Subject: [PATCH] Make commit id an argument for the build publish script. (#536) * Make commit id an argument for the build publish script. * Make commit an optional argument for publish script. --- build/tfs/common/publish.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/build/tfs/common/publish.ts b/build/tfs/common/publish.ts index 8fb87733a2..18cdaa14eb 100644 --- a/build/tfs/common/publish.ts +++ b/build/tfs/common/publish.ts @@ -14,8 +14,8 @@ import * as mime from 'mime'; import * as minimist from 'minimist'; import { DocumentClient, NewDocument } from 'documentdb'; -if (process.argv.length < 6) { - console.error('Usage: node publish.js '); +if (process.argv.length < 9) { + console.error('Usage: node publish.js [commit_id]'); process.exit(-1); } @@ -263,8 +263,10 @@ function main(): void { boolean: ['upload-only'] }); - const [quality, platform, type, name, version, _isUpdate, file] = opts._; - const commit = execSync('git rev-parse HEAD', { encoding: 'utf8' }).trim(); + let [quality, platform, type, name, version, _isUpdate, file, commit] = opts._; + if (!commit) { + commit = execSync('git rev-parse HEAD', { encoding: 'utf8' }).trim(); + } publish(commit, quality, platform, type, name, version, _isUpdate, file, opts).catch(err => { console.error(err);