Skip to content

Commit d37af97

Browse files
committed
Fixes for PR review comments
1 parent 6dcd891 commit d37af97

File tree

6 files changed

+30
-6
lines changed

6 files changed

+30
-6
lines changed

.codeql-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2.24.1-prerelease
1+
v2.24.1

.github/workflows/release-npm.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ jobs:
101101
server/dist/
102102
server/ql/
103103
server/package.json
104+
server/scripts/setup-packs.sh
104105
README.md
105106
LICENSE
106107
docs/

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ jobs:
181181
cp -r server/ql dist-package/server/
182182
cp server/package.json dist-package/server/
183183
184+
# Copy scripts (setup-packs.sh is referenced by the bin field)
185+
mkdir -p dist-package/server/scripts
186+
cp server/scripts/setup-packs.sh dist-package/server/scripts/
187+
184188
# Copy root files
185189
cp README.md dist-package/
186190
cp LICENSE dist-package/

docs/getting-started.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ npm install -g codeql-development-mcp-server
2222
codeql-development-mcp-server-setup-packs
2323
```
2424

25+
> **Note (Windows):** The `codeql-development-mcp-server-setup-packs` command
26+
> requires a Bash-compatible shell (e.g., Git Bash or WSL). On Windows without
27+
> Bash, run `setup-packs.sh` directly from the package's `scripts/` directory.
28+
2529
Or use `npx` to run without a global install:
2630

2731
```bash

server/scripts/setup-packs.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,18 @@ fi
8585
## Works from both:
8686
## npm layout: <pkg>/scripts/setup-packs.sh → <pkg>/ql/
8787
## monorepo layout: server/scripts/setup-packs.sh → server/ql/
88-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
88+
## When invoked via npm bin shim/symlink, BASH_SOURCE[0] may point to the
89+
## .bin/ directory. Resolve the real path first to find the actual package root.
90+
SCRIPT_PATH="${BASH_SOURCE[0]}"
91+
if command -v realpath &> /dev/null; then
92+
SCRIPT_PATH="$(realpath "${SCRIPT_PATH}")"
93+
elif command -v readlink &> /dev/null; then
94+
# macOS readlink doesn't support -f, use a loop
95+
while [ -L "${SCRIPT_PATH}" ]; do
96+
SCRIPT_PATH="$(readlink "${SCRIPT_PATH}")"
97+
done
98+
fi
99+
SCRIPT_DIR="$(cd "$(dirname "${SCRIPT_PATH}")" && pwd)"
89100
PACKAGE_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
90101
QL_ROOT="${PACKAGE_ROOT}/ql"
91102

server/scripts/update-release-version.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,16 +258,20 @@ update_versions() {
258258
echo "=== Updating Release Version to ${new_version} ==="
259259
echo ""
260260

261-
## 1. Update .codeql-version (uses v prefix)
261+
## 1. Update .codeql-version (uses v prefix, base version only)
262+
## .codeql-version stores the CodeQL CLI version (X.Y.Z), NOT the project
263+
## release version. For prerelease tags like 2.24.1-beta, we write v2.24.1.
264+
local base_version
265+
base_version=$(extract_base_version "${new_version}")
262266
local codeql_version_file="${REPO_ROOT}/.codeql-version"
263267
if [[ -f "${codeql_version_file}" ]]; then
264268
local old_version
265269
old_version=$(tr -d '[:space:]' < "${codeql_version_file}")
266270
if [[ "${dry_run}" == true ]]; then
267-
echo " [DRY RUN] .codeql-version: ${old_version} -> v${new_version}"
271+
echo " [DRY RUN] .codeql-version: ${old_version} -> v${base_version}"
268272
else
269-
printf "v%s\n" "${new_version}" > "${codeql_version_file}"
270-
echo " ✅ .codeql-version: ${old_version} -> v${new_version}"
273+
printf "v%s\n" "${base_version}" > "${codeql_version_file}"
274+
echo " ✅ .codeql-version: ${old_version} -> v${base_version}"
271275
fi
272276
updated_count=$((updated_count + 1))
273277
fi

0 commit comments

Comments
 (0)