From d0d71a54f6769c6945e4c6e8f5aee9f3e59b29e2 Mon Sep 17 00:00:00 2001 From: Tapani Moilanen Date: Fri, 23 Dec 2016 18:38:26 +0200 Subject: [PATCH] feat(cli): print error and don't run with node <4, closes #124 --- bin/cli.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/bin/cli.js b/bin/cli.js index c80a2e129..ceafbcc46 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -2,8 +2,13 @@ var standardVersion = require('../index') var cmdParser = require('../command') -standardVersion(cmdParser.argv, function (err) { - if (err) { - process.exit(1) - } -}) +/* istanbul ignore if */ +if (process.version.match(/v(\d+)\./)[1] < 4) { + console.error('standard-version: Node v4 or greater is required. `standard-version` did not run.') +} else { + standardVersion(cmdParser.argv, function (err) { + if (err) { + process.exit(1) + } + }) +}