configure-node 706 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. #
  3. # configure - Configure a node application
  4. #
  5. if [ -f package.json ] ; then
  6. echo 'yarn install ...'
  7. output=$(yarn install --ignore-optional --silent --no-progress --mutex file:/tmp/.yarn-mutex 2>&1)
  8. if [ $? = 0 ] ; then
  9. echo ${output} | perl -pe 's/\e([^\[\]]|\[.*?[a-zA-Z]|\].*?\a)//g' | egrep -v 'Waiting for the other'
  10. else
  11. echo "Yarn failed"
  12. echo ${output}
  13. exit 1
  14. fi
  15. fi
  16. if [ -f typings.json ] ; then
  17. echo 'typings install ...'
  18. output=$(typings install >/dev/null 2>&1)
  19. if [ $? = 0 ] ; then
  20. echo ${output} | grep -v deprecated
  21. else
  22. echo "Typings failed"
  23. echo ${output}
  24. exit 1
  25. fi
  26. fi