Skip to content

Instantly share code, notes, and snippets.

View Lycofuture's full-sized avatar
🎯
Focusing

sameu Lycofuture

🎯
Focusing
View GitHub Profile
@Lycofuture
Lycofuture / remove-node-modules.sh
Created August 4, 2023 09:56 — forked from mehunk/remove-node-modules.sh
遍历当前目录和子目录删除所有本地下载的 node_modules 依赖目录以节省磁盘空间。
#! /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` # 注意此处这是两个反引号,表示运行系统命令