Skip to content

Commit

Permalink
fix: remove redundant Node.js 10 warning (#1774)
Browse files Browse the repository at this point in the history
  • Loading branch information
erezrokah authored Jan 20, 2021
1 parent ccc06fc commit 3c0256c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@
"raw-body": "^2.4.1",
"resolve": "^1.12.0",
"safe-join": "^0.1.3",
"semver": "^7.3.4",
"static-server": "^2.2.1",
"strip-ansi-control-characters": "^2.0.0",
"to-readable-stream": "^2.1.0",
Expand Down
14 changes: 1 addition & 13 deletions src/lib/deprecations.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
const path = require('path')
const process = require('process')

const pathExists = require('path-exists')
const semverLessThan = require('semver/functions/lt')

const { NETLIFYDEVWARN } = require('../utils/logo')

const warnOnOldNodeVersion = ({ log, chalk }) => {
if (semverLessThan(process.version, '10.0.0')) {
log(
`${NETLIFYDEVWARN} ${chalk.bold('Netlify CLI')} will require ${chalk.magenta.bold(
'Node.js 10',
)} or greater soon. Please update your Node.js version.`,
)
}
}

const NETLIFY_DIR = 'netlify'
const DEFAULT_FUNCTIONS_SRC = path.join(NETLIFY_DIR, 'functions')

Expand Down Expand Up @@ -63,4 +51,4 @@ const warnOnNetlifyDir = async ({ log, chalk, buildDir }) => {
}
}

module.exports = { warnOnOldNodeVersion, warnOnNetlifyDir }
module.exports = { warnOnNetlifyDir }
3 changes: 1 addition & 2 deletions src/utils/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const merge = require('lodash/merge')
const argv = require('minimist')(process.argv.slice(2))
const API = require('netlify')

const { warnOnOldNodeVersion, warnOnNetlifyDir } = require('../lib/deprecations')
const { warnOnNetlifyDir } = require('../lib/deprecations')
const { getAgent } = require('../lib/http-agent')

const chalkInstance = require('./chalk')
Expand Down Expand Up @@ -104,7 +104,6 @@ class BaseCommand extends Command {
state,
}

warnOnOldNodeVersion({ log: this.log, chalk: this.chalk })
// @netlify/build already warns about this issue
if (!isBuildCommand()) {
await warnOnNetlifyDir({ log: this.log, chalk: this.chalk, buildDir })
Expand Down

0 comments on commit 3c0256c

Please sign in to comment.