Browse Source
Find the closest `package.json` automatically
master
Leo Lamprecht
8 years ago
No known key found for this signature in database
GPG Key ID: B08517883D5E0E10
2 changed files with
16 additions and
11 deletions
-
bin/now.js
-
package.json
|
|
@ -7,10 +7,10 @@ const {resolve} = require('path') |
|
|
|
const nodeVersion = require('node-version') |
|
|
|
const updateNotifier = require('update-notifier') |
|
|
|
const chalk = require('chalk') |
|
|
|
const pkgUp = require('pkg-up') |
|
|
|
|
|
|
|
// Ours
|
|
|
|
const {error} = require('../lib/error') |
|
|
|
const pkg = require('../package') |
|
|
|
|
|
|
|
// Throw an error if node version is too low
|
|
|
|
if (nodeVersion.major < 6) { |
|
|
@ -18,8 +18,11 @@ if (nodeVersion.major < 6) { |
|
|
|
process.exit(1) |
|
|
|
} |
|
|
|
|
|
|
|
// Only check for updates in the npm version
|
|
|
|
if (!process.pkg && pkg.dist) { |
|
|
|
pkgUp().then(packagePath => { |
|
|
|
const pkg = require(packagePath) |
|
|
|
|
|
|
|
// Only check for updates in the npm version
|
|
|
|
if (!process.pkg && pkg.dist) { |
|
|
|
const notifier = updateNotifier({pkg}) |
|
|
|
const update = notifier.update |
|
|
|
|
|
|
@ -30,7 +33,8 @@ if (!process.pkg && pkg.dist) { |
|
|
|
|
|
|
|
notifier.notify({message}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
// This command will be run if no other sub command is specified
|
|
|
|
const defaultCommand = 'deploy' |
|
|
|
|
|
@ -84,6 +84,7 @@ |
|
|
|
"node-fetch": "1.6.3", |
|
|
|
"node-version": "1.0.0", |
|
|
|
"ora": "1.1.0", |
|
|
|
"pkg-up": "1.0.0", |
|
|
|
"progress": "1.1.8", |
|
|
|
"psl": "1.1.16", |
|
|
|
"resumer": "0.0.0", |
|
|
|