-
-
Save jeaye/3669b2d1a5f5396684e7ebb34458a94c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
cd "$(dirname "${BASH_SOURCE[0]}")" | |
pidkill() | |
{ | |
set +e | |
x=$(lsof -i ":$1" -sTCP:LISTEN -P -n -F p | grep '^p' | sed 's/^p//' | head -1) | |
if [[ "$x" != "" ]]; | |
then | |
echo "Killing PID $x listening on port $1..." | |
kill "$x" | |
fi | |
set -e | |
} | |
# Kill packager and all its files. | |
pidkill 8081 | |
find /tmp -maxdepth 1 -name 'metro-bundler-*' -exec rm -r {} + | |
rm -rf node_modules | |
lein clean | |
pushd android | |
adb uninstall app/build/outputs/apk/app-debug.apk 2>/dev/null | |
./gradlew clean 2>/dev/null || true | |
popd | |
# Now start generating things again. | |
npm install | |
re-natal use-figwheel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment