Skip to content

Commit 67687ac

Browse files
committed
build: fix yarn errors upon npm install minidump
- Only run `git submodule update` when running out of a git working copy - Don't require `yarn` for end-user installation
1 parent ad0ae87 commit 67687ac

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

build.js

+8
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ function spawnSync (...args) {
2727
}
2828
}
2929

30+
if (fs.existsSync(path.join(__dirname, '.git'))) {
31+
// this is a development working tree of `node-minidump`, not an end-user install of the `minidump` package
32+
spawnSync('git', ['submodule', 'update', '--init', '--recursive'], {
33+
cwd: __dirname,
34+
stdio: 'inherit',
35+
})
36+
}
37+
3038
const buildDir = path.join(__dirname, 'build', getEffectiveArch())
3139
if (!fs.existsSync(buildDir)) {
3240
fs.mkdirSync(buildDir, { recursive: true })

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"scripts": {
1919
"prepublishOnly": "shx chmod -R +x ./bin",
20-
"preinstall": "yarn submodule && node build.js",
20+
"preinstall": "node build.js",
2121
"submodule": "git submodule update --init --recursive",
2222
"test": "mocha test && standard"
2323
},

0 commit comments

Comments
 (0)