Skip to content

Commit 8580017

Browse files
committed
fix: scripts bug fix
1 parent b56407f commit 8580017

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

package.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,5 @@
99
},
1010
"devDependencies": {
1111
"nx": "19.6.3"
12-
},
13-
"dependencies": {
14-
"@lit-protocol/auth-helpers": "^6.4.10",
15-
"@lit-protocol/constants": "^6.4.10",
16-
"@lit-protocol/contracts-sdk": "^6.4.10",
17-
"@lit-protocol/lit-node-client-nodejs": "^6.4.10"
1812
}
1913
}

scripts/update-lit.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
#!/bin/bash
22

33
TARGET_DIR="${1:-$(pwd)}"
4+
TARGET_DIR=$(realpath "$TARGET_DIR")
45

5-
if [ -f "$TARGET_DIR/package.json" ]; then
6+
if [ -d "$TARGET_DIR" ]; then
7+
cd "$TARGET_DIR" || exit
68
echo "Updating lit-protocol dependencies in $TARGET_DIR"
79

8-
for pkg in $(jq -r '.dependencies | keys[] | select(test("^@lit-protocol"))' "$TARGET_DIR/package.json"); do
9-
LATEST_VERSION=$(npm show $pkg version)
10-
echo "Updating $pkg to version ^$LATEST_VERSION"
11-
npm pkg set "dependencies.$pkg=^$LATEST_VERSION"
12-
done
10+
if [ -f "package.json" ]; then
11+
for pkg in $(jq -r '.dependencies | keys[] | select(test("^@lit-protocol"))' "package.json"); do
12+
LATEST_VERSION=$(npm show $pkg version)
13+
echo "Updating $pkg to version ^$LATEST_VERSION"
14+
npm pkg set "dependencies.$pkg=^$LATEST_VERSION"
15+
done
16+
else
17+
echo "No package.json found in $TARGET_DIR."
18+
fi
1319
else
14-
echo "No package.json found in $TARGET_DIR."
20+
echo "Directory $TARGET_DIR does not exist."
1521
fi

0 commit comments

Comments
 (0)