Skip to content

Commit

Permalink
Merge pull request #748 from frog-pond/drew/build-watch-script
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkrives authored May 25, 2024
2 parents 30c810e + 8581fac commit 76385d1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"test-stolaf-college": "./scripts/smoke-test.sh stolaf-college",
"test-carleton-college": "./scripts/smoke-test.sh carleton-college",
"test": "ava",
"watch": "echo \"npm run build-watch\" and \"npm run start-watch\""
"watch": "node ./scripts/watch.js"
},
"dependencies": {
"@sentry/node": "^8.0.0-rc.1",
Expand Down
13 changes: 13 additions & 0 deletions scripts/watch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {spawn} from 'child_process'

const buildWatch = spawn('npm', ['run', 'build-watch'], {stdio: 'inherit'})
const startWatch = spawn('npm', ['run', 'start-watch'], {stdio: 'inherit'})

const shutdown = () => {
buildWatch.kill()
startWatch.kill()
process.exit()
}

process.on('SIGINT', shutdown)
process.on('SIGTERM', shutdown)

0 comments on commit 76385d1

Please sign in to comment.