You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
484 B
13 lines
484 B
const rpj = require('read-package-json-fast')
|
|
const runScriptPkg = require('./run-script-pkg.js')
|
|
const validateOptions = require('./validate-options.js')
|
|
const isServerPackage = require('./is-server-package.js')
|
|
|
|
const runScript = options => {
|
|
validateOptions(options)
|
|
const {pkg, path} = options
|
|
return pkg ? runScriptPkg(options)
|
|
: rpj(path + '/package.json').then(pkg => runScriptPkg({...options, pkg}))
|
|
}
|
|
|
|
module.exports = Object.assign(runScript, { isServerPackage })
|