Skip to content

Commit 719fb75

Browse files
committed
fix sync script
1 parent f56ae01 commit 719fb75

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

sw/bin/executable_sync_coderabbitai.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ pull_all.sh ~/Work/coderabbitai
77
# look for package.json files in the subdirectories
88
# and run pnpm install in those directories
99
find ~/Work/coderabbitai -name package.json -exec dirname {} \; | while read dir; do
10-
echo "Installing dependencies in $dir"
11-
(cd $dir && pnpm install)
10+
# if the directory contains a pnpm-lock.yaml file use pnpm
11+
# otherwise look for a yarn.lock file and use yarn
12+
# otherwise look for a package-lock.json file and use npm
13+
if [ -f "$dir/pnpm-lock.yaml" ]; then
14+
echo "Running pnpm install in $dir"
15+
(cd $dir && pnpm install)
16+
elif [ -f "$dir/yarn.lock" ]; then
17+
echo "Running yarn install in $dir"
18+
(cd $dir && yarn install)
19+
elif [ -f "$dir/package-lock.json" ]; then
20+
echo "Running npm install in $dir"
21+
(cd $dir && npm install)
22+
fi
1223
done

0 commit comments

Comments
 (0)