Skip to content

Commit 5e24d48

Browse files
committed
fix: making update-lit callable with directory context
1 parent b52023f commit 5e24d48

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@ Reports the versions of dependencies starting with `@lit-protocol`
2121
node ./report.mjs --tag=latest
2222
node ./report.mjs --tag=datil-dev
2323
```
24+
25+
Update lit sdk on a specific subdirectory
26+
```
27+
./scripts/update-lit.sh conditional-signing/nodejs
28+
```

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,11 @@
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"
1218
}
13-
}
19+
}

scripts/update-lit.sh

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

3-
CALLER_DIR=$(pwd)
3+
TARGET_DIR="${1:-$(pwd)}"
44

5-
if [ -f "$CALLER_DIR/package.json" ]; then
6-
echo "Updating lit-protocol dependencies in $CALLER_DIR"
5+
if [ -f "$TARGET_DIR/package.json" ]; then
6+
echo "Updating lit-protocol dependencies in $TARGET_DIR"
77

8-
for pkg in $(jq -r '.dependencies | keys[] | select(test("^@lit-protocol"))' "$CALLER_DIR/package.json"); do
8+
for pkg in $(jq -r '.dependencies | keys[] | select(test("^@lit-protocol"))' "$TARGET_DIR/package.json"); do
99
LATEST_VERSION=$(npm show $pkg version)
1010
echo "Updating $pkg to version ^$LATEST_VERSION"
1111
npm pkg set "dependencies.$pkg=^$LATEST_VERSION"
1212
done
1313
else
14-
echo "No package.json found in $CALLER_DIR."
14+
echo "No package.json found in $TARGET_DIR."
1515
fi

0 commit comments

Comments
 (0)