Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. #!/usr/bin/env bash
  2. set -euo pipefail && cd "$(dirname "${BASH_SOURCE[0]}")/.."
  3.  
  4. # When you're down and out
  5. # When you're on the street
  6. # When evening falls so hard, I will comfort you
  7. # I will clean your build artifacts
  8.  
  9. # Disclaimer: use at your own risk
  10.  
  11. pidkill() {
  12. set +e
  13. x=$(lsof -i ":$1" -sTCP:LISTEN -P -n -F p | grep '^p' | sed 's/^p//' | head -1)
  14.  
  15. if [[ "$x" != "" ]]; then
  16. echo "Killing PID $x listening on port $1..."
  17. kill "$x"
  18. fi
  19. set -e
  20. }
  21.  
  22. # remove everything, just to be shure
  23.  
  24. rm -rf target
  25. rm -rf ios/build
  26. rm -rf "$HOME/Library/Developer/Xcode/DerivedData"
  27.  
  28. lein clean
  29.  
  30. re-natal use-figwheel
  31.  
  32. pidkill 8081 # kill packager
  33.  
  34. # delete react native packager cache
  35.  
  36. find "$TMPDIR" -depth 1 -name 'react-*' -delete
  37.  
  38. if which watchman; then
  39. watchman watch-del-all
  40. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement