Skip to content

Commit ffff3ab

Browse files
committed
fix: remove node_modules directory before component installation
1 parent 6899562 commit ffff3ab

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

setup.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,11 @@ install_component() {
10251025
exit 1
10261026
fi
10271027

1028+
cprint cyan "Removing node_modules folder: $target_path/node_modules/"
1029+
if [[ -d "$target_path/node_modules/" ]]; then
1030+
rm -rf "$target_path/node_modules/"
1031+
fi
1032+
10281033
if cp -a "$source_path"/. "$target_path"; then
10291034
cprint green "Updated files from $source_path$target_path"
10301035
rm -rf "$source_path"

setup_cn.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,11 @@ install_component() {
10211021
cleanup_install_tmp
10221022
exit 1
10231023
fi
1024+
1025+
cprint cyan "删除依赖库文件 $target_path/node_modules/"
1026+
if [[ -d "$target_path/node_modules/" ]]; then
1027+
rm -rf "$target_path/node_modules/"
1028+
fi
10241029

10251030
if cp -a "$source_path"/. "$target_path"; then
10261031
cprint green "更新的文件 $source_path$target_path"
@@ -1054,7 +1059,7 @@ install_component() {
10541059
cleanup_install_tmp
10551060
exit 1
10561061
fi
1057-
1062+
10581063
popd >/dev/null
10591064
cprint green bold "组件 '$component' 安装/更新成功."
10601065
}

0 commit comments

Comments
 (0)