installWebADB.sh 538 B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. directory_path=$1
  3. if [ -d "$directory_path" ]; then
  4. echo "Directory exists, proceeding..."
  5. else
  6. echo "Directory does not exist"
  7. exit 0
  8. fi
  9. directories=$(find "$directory_path/libraries" -mindepth 1 -maxdepth 1 -type d)
  10. if test -f "./webadb.packages.txt"; then
  11. rm webadb.packages.txt
  12. touch webadb.packages.txt
  13. else
  14. touch webadb.packages.txt
  15. fi
  16. for dir in $directories; do
  17. npm install "$dir" --save
  18. package=$(echo $dir | awk -F '/' '{print $NF}')
  19. echo "@yume-chan/$package" >> webadb.packages.txt
  20. done