node-minidump
node-minidump copied to clipboard
build: fix yarn errors upon `npm install minidump`
- Only run
git submodule updatewhen running out of a git working copy - Don't require
yarnfor end-user installation (or any installation, since it's not listed as a dep)
Closes #93
This fixes the following 3 errors:
development without yarn installed globally
$ git clone [email protected]:electron/node-minidump.git && cd node-minidump
$ npm install
> [email protected] preinstall
> yarn submodule && node build.js
sh: 1: yarn: not found
end-user installing of minidump (or any package depending on it) without yarn installed locally or globally
$ mkdir newproj && cd newproj && echo {} > package.json
$ npm i minidump
npm ERR! command failed
npm ERR! command sh -c yarn submodule && node build.js
npm ERR! sh: 1: yarn: not found
end-user installing of minidump (or any package depending on it) in a non-git-controlled working directory:
$ mkdir newproj && cd newproj && echo {} > package.json
$ npm i yarn
$ npm i minidump
npm ERR! command failed
npm ERR! command sh -c yarn submodule && node build.js
npm ERR! yarn run v1.22.22
npm ERR! $ git submodule update --init --recursive
npm ERR! info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
npm ERR! warning ../../package.json: No license field
npm ERR! fatal: not a git repository (or any of the parent directories): .git
Note: simply reverting 4be7737 will solve the last two end-user problems, presumably a situation like the first one was what that commit was attempting to solve (and it did solve it, as long as you have yarn installed globally, which, as far as I know, is not generally recommended), hopefully my addition to build.js will solve more elegantly solve the development case without needing to add external (non-dev) dependencies.
Updated (and force-pushed) to remove trailing command that was causing a style check failure.