Last change
on this file since 1ad8e64 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
484 bytes
|
Line | |
---|
1 | const rpj = require('read-package-json-fast')
|
---|
2 | const runScriptPkg = require('./run-script-pkg.js')
|
---|
3 | const validateOptions = require('./validate-options.js')
|
---|
4 | const isServerPackage = require('./is-server-package.js')
|
---|
5 |
|
---|
6 | const runScript = options => {
|
---|
7 | validateOptions(options)
|
---|
8 | const {pkg, path} = options
|
---|
9 | return pkg ? runScriptPkg(options)
|
---|
10 | : rpj(path + '/package.json').then(pkg => runScriptPkg({...options, pkg}))
|
---|
11 | }
|
---|
12 |
|
---|
13 | module.exports = Object.assign(runScript, { isServerPackage })
|
---|
Note:
See
TracBrowser
for help on using the repository browser.