Skip to content

Commit

Permalink
deprecated version message
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Balestra committed Jul 13, 2017
1 parent 9e356e2 commit d5057ba
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/cli/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
'use strict';

const cli = require('yargs');
const colors = require('colors/safe');
const commands = require('./commands');
const format = require('stringformat');
const _ = require('lodash');
const semver = require('semver');

const Local = require('./domain/local');
const logger = require('./logger');
const Registry = require('./domain/registry');
const strings = require('../resources');
const validateCommand = require('./validate-command');

const currentNodeVersion = process.version;
const minSupportedVersion = '6.0.0';
if (semver.lt(currentNodeVersion, minSupportedVersion)) {
console.log(
colors.red(
format(
strings.errors.cli.NODE_CLI_VERSION_UNSUPPORTED,
currentNodeVersion,
minSupportedVersion
)
)
);
}

const dependencies = {
local: new Local(),
logger,
Expand Down
2 changes: 2 additions & 0 deletions src/resources/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ module.exports = {
'the name is not valid. Allowed characters are alphanumeric, _, -',
NODE_CLI_VERSION_NEEDS_UPGRADE:
"the version of used node is invalid. Try to upgrade node to version matching '{0}'",
NODE_CLI_VERSION_UNSUPPORTED:
"ALERT: You're currently running OC on an unsupported Node version ({0}).\nPlease upgrade Node to >= {1}.",
OC_CLI_VERSION_NEEDS_UPGRADE:
'the version of used OC CLI is invalid. Try to upgrade OC CLI running {0}',
PACKAGE_CREATION_FAIL: 'An error happened when creating the package: {0}',
Expand Down

0 comments on commit d5057ba

Please sign in to comment.