From ddbf3537896a48345c20c00e8e29d309e64a6bdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Vy=C5=A1insk=C3=BD?= Date: Fri, 13 May 2022 13:47:02 +0200 Subject: [PATCH] feat: add `-v|--version` argument option to cli command --- bin/sfcc-playground.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/sfcc-playground.js b/bin/sfcc-playground.js index 07244b0..d7ae32d 100755 --- a/bin/sfcc-playground.js +++ b/bin/sfcc-playground.js @@ -1,4 +1,11 @@ #!/usr/bin/env node -const { run } = require('../src/app'); +const arg = process.argv[2]; -run(); +if (arg === '-v' || arg === '--version') { + const { version } = require('../package.json'); + + process.stdout.write(version + '\n'); + return; +} + +require('../src/app').run();