disable.sh 928 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. community=$(cd -- "$(dirname "$0")" &> /dev/null && cd ../../.. && pwd)
  3. disableInDir () {
  4. cd "$1"
  5. git config --unset core.hooksPath
  6. rm .eslintignore
  7. rm .prettierignore
  8. rm .eslintrc.json
  9. rm .prettierrc.json
  10. rm package.json
  11. rm package-lock.json
  12. rm -r node_modules
  13. cd - &> /dev/null
  14. }
  15. read -p "Do you want to delete the tooling installed in enterprise too ? [y, n]" willingToDeleteToolingInEnterprise
  16. if [[ $willingToDeleteToolingInEnterprise != "n" ]]
  17. then
  18. read -p "What is the relative path from community to enterprise ? (../enterprise)" pathToEnterprise
  19. pathToEnterprise=${pathToEnterprise:-../enterprise}
  20. pathToEnterprise=$(realpath $community/$pathToEnterprise)
  21. fi
  22. disableInDir "$community"
  23. if [[ $willingToDeleteToolingInEnterprise != "n" ]]
  24. then
  25. disableInDir "$pathToEnterprise"
  26. fi
  27. echo ""
  28. echo "JS tooling have been removed from the roots"
  29. echo ""