Skip to content

Commit

Permalink
Merge pull request #3 from eosnetworkfoundation/zach-reset
Browse files Browse the repository at this point in the history
Add Script to Sanitize Environment
  • Loading branch information
kj4ezj authored Jul 6, 2024
2 parents adb292d + 433940f commit 7abf3bf
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"dev": "vite dev",
"preview": "vite preview",
"serve": "./serve.sh"
"reset": "scripts/reset.sh",
"serve": "scripts/serve.sh"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.0.0",
Expand Down
18 changes: 18 additions & 0 deletions scripts/reset.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
set -eo pipefail

function ee()
{
echo "$ $*"
eval "$@" || :
}

echo 'Resetting nodeJS environment...'
NPM_ROOT="$(npm run env | grep '^PWD' | cut -d '=' -f '2')"
pushd "$NPM_ROOT"
ee 'jest --clearCache'
ee 'rm -r build coverage node_modules .svelte-kit'
ee 'yarn cache clean'
echo 'nodeJS environment sanitized.'
popd
echo "Done. - ${BASH_SOURCE[0]}"
2 changes: 1 addition & 1 deletion serve.sh → scripts/serve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function ee {
}

echo 'Starting local Caddy web server.'
echo -e '\e[1;35mURL: https://localhost:8443\e[0m'
echo -e '\e[1;36mURL: https://localhost:8443\e[0m'
echo -e '\e[1;93mPress [Ctrl] + C to exit...\e[0m'

ee "docker run -v \"\$(git rev-parse --show-toplevel):/http\" -w '/http' -p '8443:8443' caddy caddy run --config caddyfile"

0 comments on commit 7abf3bf

Please sign in to comment.