Skip to content

Commit afa3eed

Browse files
authored
Update scripts/runclinecore.sh to include platform specific node module path (cline#6618)
With the introduction of better sqlite, this script needs to set the correct path for platform specific node modules. The logic is copied from the JB plugin (the vscode extension does not set the node modules path).
1 parent 9b6a120 commit afa3eed

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

‎scripts/runclinecore.sh‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,26 @@ unp $ZIP_FILE > /dev/null
2525

2626
pkill -f cline-core.js || true
2727

28+
# Detect platform name using the same logic as ClineDirs.kt in the plugin.
29+
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
30+
ARCH=$(uname -m)
31+
32+
if [[ "$OS" == "darwin" && "$ARCH" == "x86_64" ]]; then
33+
PLATFORM_NAME="darwin-x64"
34+
elif [[ "$OS" == "darwin" && "$ARCH" == "arm64" ]]; then
35+
PLATFORM_NAME="darwin-arm64"
36+
elif [[ "$OS" == *"mingw"* || "$OS" == *"cygwin"* || "$OS" == *"msys"* ]] && [[ "$ARCH" == "x86_64" || "$ARCH" == "amd64" ]]; then
37+
# Note: This script requires a bash-compatible environment on Windows (Git Bash, MSYS2, Cygwin)
38+
PLATFORM_NAME="win-x64"
39+
elif [[ "$OS" == "linux" && ("$ARCH" == "x86_64" || "$ARCH" == "amd64") ]]; then
40+
PLATFORM_NAME="linux-x64"
41+
else
42+
echo "Unsupported platform: $OS $ARCH"
43+
exit 1
44+
fi
45+
46+
BINARY_MODULES_DIR="./binaries/$PLATFORM_NAME/node_modules"
47+
2848
echo pwd: $(pwd)
2949
set -x
30-
NODE_PATH=./node_modules DEV_WORKSPACE_FOLDER=/tmp/ node cline-core.js 2>&1 | tee $LOG_FILE
50+
NODE_PATH=$BINARY_MODULES_DIR:./node_modules DEV_WORKSPACE_FOLDER=/tmp/ node cline-core.js 2>&1 | tee $LOG_FILE

0 commit comments

Comments
 (0)