From afa3eed7ebb079ba3b83cadc207da64a44e193bf Mon Sep 17 00:00:00 2001 From: Sarah Fortune Date: Thu, 2 Oct 2025 21:21:39 +0000 Subject: [PATCH] Update scripts/runclinecore.sh to include platform specific node module path (#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). --- scripts/runclinecore.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/scripts/runclinecore.sh b/scripts/runclinecore.sh index 758b649f6e..d01b34015a 100755 --- a/scripts/runclinecore.sh +++ b/scripts/runclinecore.sh @@ -25,6 +25,26 @@ unp $ZIP_FILE > /dev/null pkill -f cline-core.js || true +# Detect platform name using the same logic as ClineDirs.kt in the plugin. +OS=$(uname -s | tr '[:upper:]' '[:lower:]') +ARCH=$(uname -m) + +if [[ "$OS" == "darwin" && "$ARCH" == "x86_64" ]]; then + PLATFORM_NAME="darwin-x64" +elif [[ "$OS" == "darwin" && "$ARCH" == "arm64" ]]; then + PLATFORM_NAME="darwin-arm64" +elif [[ "$OS" == *"mingw"* || "$OS" == *"cygwin"* || "$OS" == *"msys"* ]] && [[ "$ARCH" == "x86_64" || "$ARCH" == "amd64" ]]; then + # Note: This script requires a bash-compatible environment on Windows (Git Bash, MSYS2, Cygwin) + PLATFORM_NAME="win-x64" +elif [[ "$OS" == "linux" && ("$ARCH" == "x86_64" || "$ARCH" == "amd64") ]]; then + PLATFORM_NAME="linux-x64" +else + echo "Unsupported platform: $OS $ARCH" + exit 1 +fi + +BINARY_MODULES_DIR="./binaries/$PLATFORM_NAME/node_modules" + echo pwd: $(pwd) set -x -NODE_PATH=./node_modules DEV_WORKSPACE_FOLDER=/tmp/ node cline-core.js 2>&1 | tee $LOG_FILE +NODE_PATH=$BINARY_MODULES_DIR:./node_modules DEV_WORKSPACE_FOLDER=/tmp/ node cline-core.js 2>&1 | tee $LOG_FILE