Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 946a02f

Browse files
committed
build: Determine better-sqlite3 version automatically
1 parent 6a7f95f commit 946a02f

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

bin/better-sqlite3/update.sh

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
#!/usr/bin/env bash
22
ELECTRON_VERSION="electron-v125"
33
NODE_VERSION="node-v115"
4-
BETTER_SQLITE3_VERSION=11.1.2
4+
5+
if ! command -v jq &> /dev/null; then
6+
echo "Missing command: jq"
7+
exit 1
8+
fi
9+
10+
script_dir=$(realpath $(dirname $0))
11+
cd "$script_dir"
12+
BETTER_SQLITE3_VERSION=$(jq -r '.dependencies.["better-sqlite3"]' ../../package.json | grep -oP "\d+\.\d+\.\d+")
13+
14+
if [ -z $BETTER_SQLITE3_VERSION ]; then
15+
echo "Unable to determine better-sqlite3 version."
16+
exit 2
17+
fi
18+
19+
echo "Version: $BETTER_SQLITE3_VERSION"
520

621
function download() {
722
version="$1"
@@ -16,9 +31,6 @@ function download() {
1631
rm -f "$temp_file"
1732
}
1833

19-
script_dir=$(realpath $(dirname $0))
20-
cd "$script_dir"
21-
2234
download $NODE_VERSION "linux-x64" "linux-server"
2335
download $ELECTRON_VERSION "linux-x64" "linux-desktop"
2436
download $ELECTRON_VERSION "win32-x64" "win"

0 commit comments

Comments
 (0)