From 6d6e29f2dc69db6ee4376bf1751636db76d3c787 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 6 Feb 2019 11:56:12 -0800 Subject: [PATCH] Add usage info to version script --- script/version | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/script/version b/script/version index 4373dcdb..e46898f7 100755 --- a/script/version +++ b/script/version @@ -20,7 +20,20 @@ if (npmVersion !== cargoVersion) { process.exit(1); } -if (process.argv[2]) { +const arg = process.argv[2]; + +if (!arg) { + console.log([ + `Usage: script/version major |minor | patch | `, + '', + 'Update the CLI version by the given increment or to the given', + 'version number, creating a commit and tag for the new version.', + '' + ].join('\n')) + process.exit(1); +} + +if (arg) { // Check that working directory is clean const diff = execFileSync( 'git',