|
|
@ -1,8 +1,14 @@ |
|
|
|
// Native
|
|
|
|
const { basename, resolve: resolvePath } = require('path'); |
|
|
|
|
|
|
|
// Packages
|
|
|
|
const chalk = require('chalk'); |
|
|
|
const { readFile, exists } = require('fs-promise'); |
|
|
|
const { parse: parseDockerfile } = require('docker-file-parser'); |
|
|
|
|
|
|
|
// Helpers
|
|
|
|
const { error } = require('../lib/error'); |
|
|
|
|
|
|
|
const listPackage = { |
|
|
|
scripts: { |
|
|
|
start: `NODE_ENV='production' serve ./content` |
|
|
@ -71,9 +77,10 @@ async function readMetaData( |
|
|
|
try { |
|
|
|
pkg = JSON.parse(await readFile(resolvePath(path, 'package.json'))); |
|
|
|
} catch (err) { |
|
|
|
const e = Error(`Failed to read JSON in "${path}/package.json"`); |
|
|
|
e.userError = true; |
|
|
|
throw e; |
|
|
|
error(`Failed to read JSON in "${path}/package.json"`); |
|
|
|
|
|
|
|
// eslint-disable-next-line unicorn/no-process-exit
|
|
|
|
process.exit(1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -81,12 +88,13 @@ async function readMetaData( |
|
|
|
strict && |
|
|
|
(!pkg.scripts || (!pkg.scripts.start && !pkg.scripts['now-start'])) |
|
|
|
) { |
|
|
|
const e = Error( |
|
|
|
error( |
|
|
|
'Missing `start` (or `now-start`) script in `package.json`. ' + |
|
|
|
'See: https://docs.npmjs.com/cli/start.' |
|
|
|
); |
|
|
|
e.userError = true; |
|
|
|
throw e; |
|
|
|
|
|
|
|
// eslint-disable-next-line unicorn/no-process-exit
|
|
|
|
process.exit(1); |
|
|
|
} |
|
|
|
|
|
|
|
if (!deploymentName) { |
|
|
|