1
0
Fork 0
mirror of synced 2024-07-11 01:06:04 +12:00

Use require.resolve to get the manifest on generation

This commit is contained in:
Adria Navarro 2024-01-30 15:12:09 +01:00
parent f1997fa4a8
commit 710083d9fc

View file

@ -10,8 +10,8 @@ const marked = require("marked")
* https://github.com/budibase/handlebars-helpers
*/
const { join } = require("path")
const path = require("path")
const DIRECTORY = join(__dirname, "..", "..", "..")
const COLLECTIONS = [
"math",
"array",
@ -128,7 +128,7 @@ function run() {
const foundNames = []
for (let collection of COLLECTIONS) {
const collectionFile = fs.readFileSync(
`${DIRECTORY}/node_modules/${HELPER_LIBRARY}/lib/${collection}.js`,
`${path.dirname(require.resolve(HELPER_LIBRARY))}/lib/${collection}.js`,
"utf8"
)
const collectionInfo = {}