mirror of
https://gitee.com/devlive-community/datacap.git
synced 2024-12-04 13:09:02 +08:00
24 lines
583 B
Bash
24 lines
583 B
Bash
#!/bin/bash
|
|
|
|
echo "Clean dependencies"
|
|
|
|
echo "Task: check dependencies"
|
|
depcheck --json > depcheck-output.json
|
|
|
|
echo "Task: remove unused dependencies"
|
|
UNUSED_DEPENDENCIES=$(jq -r '.dependencies[]' depcheck-output.json)
|
|
for PACKAGE in $UNUSED_DEPENDENCIES; do
|
|
pnpm remove $PACKAGE
|
|
done
|
|
|
|
echo "Task: remove unused dev dependencies"
|
|
UNUSED_DEV_DEPENDENCIES=$(jq -r '.devDependencies[]' depcheck-output.json)
|
|
for PACKAGE in $UNUSED_DEV_DEPENDENCIES; do
|
|
pnpm remove $PACKAGE --save-dev
|
|
done
|
|
|
|
echo "Task: install dependencies again"
|
|
pnpm install --fix
|
|
|
|
echo "Clean dependencies done"
|