1
0
Fork 0
mirror of synced 2024-09-08 13:41:09 +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 * https://github.com/budibase/handlebars-helpers
*/ */
const { join } = require("path") const { join } = require("path")
const path = require("path")
const DIRECTORY = join(__dirname, "..", "..", "..")
const COLLECTIONS = [ const COLLECTIONS = [
"math", "math",
"array", "array",
@ -128,7 +128,7 @@ function run() {
const foundNames = [] const foundNames = []
for (let collection of COLLECTIONS) { for (let collection of COLLECTIONS) {
const collectionFile = fs.readFileSync( const collectionFile = fs.readFileSync(
`${DIRECTORY}/node_modules/${HELPER_LIBRARY}/lib/${collection}.js`, `${path.dirname(require.resolve(HELPER_LIBRARY))}/lib/${collection}.js`,
"utf8" "utf8"
) )
const collectionInfo = {} const collectionInfo = {}