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
#! /bin/bash | |
# 迭代遍历所有的文件夹,清理下载的 node_modules 文件夹 | |
function read_dir(){ | |
if [ -d $1"/node_modules" ] | |
then | |
rm -rf $1"/node_modules" | |
echo "删除依赖成功!" | |
fi | |
for file in `ls $1` # 注意此处这是两个反引号,表示运行系统命令 |