fix(scripts): find target folder near by node_modules folder

This commit is contained in:
LongYinan 2020-03-16 11:26:21 +08:00
parent aa4f0661b3
commit 3b48e464cb
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7
2 changed files with 3 additions and 17 deletions
scripts

View file

@ -6,7 +6,6 @@ const os = require('os')
const toml = require('toml')
const fs = require('fs')
let tomlContentString
let tomlContent
let moduleName
@ -74,8 +73,10 @@ if (!parsedDist.ext) {
subcommand = `${subcommand}.node`
}
const pos = __dirname.indexOf('node_modules')
const dylibContent = fs.readFileSync(path.join(
process.cwd(),
__dirname.substring(0, pos),
'target',
targetDir,
`${dylibName}${libExt}`,