From 12109506a908a6404c0830614b89f4ca2479f7b0 Mon Sep 17 00:00:00 2001 From: Evgeny Metelkin Date: Sun, 17 Dec 2023 16:17:02 +0200 Subject: [PATCH] select version in heta-update --- bin/heta-update.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/heta-update.js b/bin/heta-update.js index 7893d953..5f7aa19c 100644 --- a/bin/heta-update.js +++ b/bin/heta-update.js @@ -6,10 +6,13 @@ const { name, version } = require('../package.json'); program .name('heta update') - .description('Update heta-compiler to the latest version.') + .description('Update heta-compiler to the latest version, or selected version if argument is set.') + .usage('[version]') .parse(process.argv); -exec(`npm install --global ${name}`, (err, stdout, stderr) => { +let forceVersion = program.args[0] || 'latest'; + +exec(`npm install --global ${name}@${forceVersion}`, (err, stdout, stderr) => { if (stderr) { process.stdout.write(stderr); process.exit(1); // BRAKE