-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Labels
Bugthing that needs fixingthing that needs fixingRelease 7.xwork is associated with a specific npm 7 releasework is associated with a specific npm 7 release
Description
Current Behavior:
trap 'exit 0' SIGINT in an npm script doesn't seem work. I use this to preform clean up after exiting running watch scripts with ctrl c (maybe there's a better way to do this?).
"scripts": {
"dev": "npm link && npm run watch && npm unlink -g react-router-hash-link",
"watch": "trap 'exit 0' SIGINT; babel src -d lib --watch --presets=@babel/preset-env,@babel/preset-react"
},
In npm v6, npm run dev links the package to global node_modules, then runs the watch script which watches for changes and re-compiles, when I'm done I ctrl c, the watch script stops and npm unlink ... is run to preform cleanup.
In npm v7, after I ctrl c, that's it, nothing runs. I ran it with --loglevel silly but nothing is printed to the terminal after I ctrl c.
Expected Behavior:
For the watch script to exit with 0 after I press ctrl c and npm unlink ... to run.
Steps To Reproduce:
You can reproduce it using my react-router-hash-link repo (the dev setup is pretty simple).
git clone git@github.com:rafgraph/react-router-hash-link.git
cd react-router-hash-link
npm install
npm run dev
# the watch script should be running...
# press ctrl cEnvironment:
- OS: MacOS 10.15.7
- Node: 12.8.3
- npm: 7.0.0-rc.4
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingRelease 7.xwork is associated with a specific npm 7 releasework is associated with a specific npm 7 release