diff --git a/build.js b/build.js index 11b8adc..dadc6e1 100644 --- a/build.js +++ b/build.js @@ -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 }) diff --git a/package.json b/package.json index 73e59fe..36091b6 100644 --- a/package.json +++ b/package.json @@ -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" },