Skip to content

Commit

Permalink
build: fix yarn errors upon npm install minidump
Browse files Browse the repository at this point in the history
- Only run `git submodule update` when running out of a git working copy
- Don't require `yarn` for end-user installation
  • Loading branch information
Jimbly committed Dec 12, 2024
1 parent ad0ae87 commit 9f969f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ function spawnSync (...args) {
}
}

if (fs.existsSync(path.join(__dirname, '.git'))) {
// this is a development working tree of `node-minidump`, not an end-user install of the `minidump` package
spawnSync('git', ['submodule', 'update', '--init', '--recursive'], {
cwd: __dirname,
stdio: 'inherit'
})
}

const buildDir = path.join(__dirname, 'build', getEffectiveArch())
if (!fs.existsSync(buildDir)) {
fs.mkdirSync(buildDir, { recursive: true })
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"scripts": {
"prepublishOnly": "shx chmod -R +x ./bin",
"preinstall": "yarn submodule && node build.js",
"preinstall": "node build.js",
"submodule": "git submodule update --init --recursive",
"test": "mocha test && standard"
},
Expand Down

0 comments on commit 9f969f1

Please sign in to comment.