Add grateful exit on SIGINT AND SIGTERM
All checks were successful
ci/woodpecker/push/build Pipeline was successful
All checks were successful
ci/woodpecker/push/build Pipeline was successful
This commit is contained in:
parent
3b0df1ddfe
commit
8e4bf59686
2 changed files with 10 additions and 1 deletions
8
frontend/add-sigint.sh
Executable file
8
frontend/add-sigint.sh
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/usr/bin/bash
|
||||||
|
|
||||||
|
echo "function shutdownGracefully() {
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
process.on('SIGINT', shutdownGracefully);
|
||||||
|
process.on('SIGTERM', shutdownGracefully);" >> ./build/index.js
|
|
@ -4,7 +4,8 @@
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
"build": "vite build",
|
"build": "vite build && yarn add-sigint",
|
||||||
|
"add-sigint": "./add-sigint.sh",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||||
|
|
Loading…
Reference in a new issue