Skip to content

Commit bf8fa75

Browse files
committed
Allow manifest to be async function or promise
1 parent a78f636 commit bf8fa75

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ const createIo = require('./io')
77
const normalize = require('./normalize')
88
const install = require('./install')
99

10-
module.exports = async manifest => {
10+
module.exports = async manifestOrFunction => {
11+
const promiseForManifest = typeof manifestOrFunction === 'function'
12+
? manifestOrFunction()
13+
: manifestOrFunction
14+
const manifest = await promiseForManifest
1115
const ioType = process.env.CURATOR_IO || manifest.ioType
1216
const pkgType = process.env.CURATOR_PKG || manifest.pkgType
1317
const hostname = os.hostname()

0 commit comments

Comments
 (0)