Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/benchmark-search-graph.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# benchmark-search-graph.sh — Time search_graph name_pattern= queries against a
# codebase-memory-mcp binary to measure the regex / LIKE pre-filter performance.
#
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# build.sh — Clean build of production binary (standard or with UI).
#
# Usage:
Expand Down
2 changes: 1 addition & 1 deletion scripts/check-nolint-whitelist.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Verify NOLINT(misc-no-recursion) only appears on whitelisted functions.
WHITELIST="src/foundation/recursion_whitelist.h"
if [ ! -f "$WHITELIST" ]; then
Expand Down
2 changes: 1 addition & 1 deletion scripts/clean.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# clean.sh — Remove ALL build artifacts, caches, and generated files.
#
# Usage: scripts/clean.sh
Expand Down
2 changes: 1 addition & 1 deletion scripts/embed-frontend.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# embed-frontend.sh — Convert built frontend assets into linkable object files.
#
# Usage: scripts/embed-frontend.sh <dist_dir> <output_dir>
Expand Down
2 changes: 1 addition & 1 deletion scripts/env.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# env.sh — Shared environment detection for all build scripts.
#
# Sourced by test.sh, build.sh, lint.sh. Not meant to run standalone.
Expand Down
2 changes: 1 addition & 1 deletion scripts/lint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# lint.sh — Run all linters (clang-tidy + cppcheck + clang-format).
#
# Usage:
Expand Down
2 changes: 1 addition & 1 deletion scripts/repro.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# repro.sh — Build + run the cumulative BUG-REPRODUCTION suite (test-repro).
#
# Unlike test.sh (the gating suite, must be GREEN), this suite is RED by design:
Expand Down
2 changes: 1 addition & 1 deletion scripts/soak-test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# soak-test.sh — Endurance test for codebase-memory-mcp.
#
# Runs compressed workload cycles: queries, file mutations, reindexes, idle periods.
Expand Down
2 changes: 1 addition & 1 deletion scripts/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# test.sh — Clean build + run all C tests with ASan + UBSan.
#
# Usage:
Expand Down
2 changes: 1 addition & 1 deletion scripts/vendor-grammar.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# vendor-grammar.sh: Vendor a single tree-sitter grammar into internal/cbm/vendored/grammars/<name>/
# Usage: ./scripts/vendor-grammar.sh <repo_url> <name> [subdir]
# repo_url: GitHub repository URL (e.g., https://github.com/tree-sitter/tree-sitter-json)
Expand Down
4 changes: 2 additions & 2 deletions src/cli/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -1933,7 +1933,7 @@ void cbm_install_hook_gate_script(const char *home, const char *binary_path) {
return;
}
(void)fprintf(f,
"#!/bin/bash\n"
"#!/usr/bin/env bash\n"
"# codebase-memory-mcp search augmenter (Claude Code PreToolUse).\n"
"# NOTE: the legacy filename is kept for zero-migration upgrades.\n"
"# Despite the name this NEVER blocks a tool call - it only adds\n"
Expand Down Expand Up @@ -1977,7 +1977,7 @@ static void cbm_install_session_reminder_script(const char *home) {
return;
}
(void)fprintf(
f, "#!/bin/bash\n"
f, "#!/usr/bin/env bash\n"
"# SessionStart hook: remind agent to use codebase-memory-mcp tools.\n"
"# Installed by codebase-memory-mcp. Fires on startup/resume/clear/compact.\n"
"cat << 'REMINDER'\n"
Expand Down
2 changes: 1 addition & 1 deletion test-infrastructure/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Local CI — test all platforms before pushing.
#
# Coverage:
Expand Down
2 changes: 1 addition & 1 deletion tests/repro/repro_issue409.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ TEST(repro_issue409_install_wires_hook_augment_not_blocking_gate) {
snprintf(script_path, sizeof(script_path),
"%s/cbm-code-discovery-gate", hooks_dir);
rp409_write_file(script_path,
"#!/bin/bash\n"
"#!/usr/bin/env bash\n"
"# Gate hook: nudges Claude toward codebase-memory-mcp for code discovery.\n"
"# First Grep/Glob/Read per session -> block. Subsequent -> allow.\n"
"# PPID = Claude Code process PID, unique per session.\n"
Expand Down
26 changes: 13 additions & 13 deletions tests/test_pipeline.c
Original file line number Diff line number Diff line change
Expand Up @@ -3707,7 +3707,7 @@ TEST(infra_parse_dotenv_quoted) {

TEST(infra_parse_shell) {
/* Port of TestParseShellScript */
const char *src = "#!/bin/bash\n"
const char *src = "#!/usr/bin/env bash\n"
"set -e\n"
"\n"
"# Configuration\n"
Expand All @@ -3726,7 +3726,7 @@ TEST(infra_parse_shell) {

cbm_shell_result_t r;
ASSERT_EQ(cbm_parse_shell_source(src, &r), 0);
ASSERT_STR_EQ(r.shebang, "/bin/bash");
ASSERT_STR_EQ(r.shebang, "/usr/bin/env bash");

ASSERT_STR_EQ(find_env_var(r.env_vars, r.env_count, "ENVIRONMENT"), "development");
ASSERT_STR_EQ(find_env_var(r.env_vars, r.env_count, "YOUR_CONTAINER_NAME"),
Expand Down Expand Up @@ -3755,7 +3755,7 @@ TEST(infra_parse_shell_with_source) {

TEST(infra_parse_shell_secret_filtered) {
/* Port of TestParseShellScriptSecretFiltered */
const char *src = "#!/bin/bash\n"
const char *src = "#!/usr/bin/env bash\n"
"export API_SECRET=\"should-not-appear\"\n"
"export DATABASE_URL=\"https://db.example.com\"\n";

Expand All @@ -3768,10 +3768,10 @@ TEST(infra_parse_shell_secret_filtered) {

TEST(infra_parse_shell_shebang_only) {
/* Port of TestParseShellScriptShebanOnly */
const char *src = "#!/bin/bash\n# just comments\n";
const char *src = "#!/usr/bin/env bash\n# just comments\n";
cbm_shell_result_t r;
ASSERT_EQ(cbm_parse_shell_source(src, &r), 0);
ASSERT_STR_EQ(r.shebang, "/bin/bash");
ASSERT_STR_EQ(r.shebang, "/usr/bin/env bash");
PASS();
}

Expand Down Expand Up @@ -4493,7 +4493,7 @@ TEST(envscan_shell_env_urls) {
FAIL("tmpdir");

write_temp_file(tmpdir, "setup.sh",
"#!/bin/bash\n"
"#!/usr/bin/env bash\n"
"export DB_URL=\"https://db.example.com/api/sync\"\n"
"APP_NAME=\"my-service\"\n"
"CALLBACK_URL=https://hooks.example.com/notify\n");
Expand Down Expand Up @@ -4668,7 +4668,7 @@ TEST(envscan_secret_value_exclusion) {

write_temp_file(
tmpdir, "deploy.sh",
"#!/bin/bash\n"
"#!/usr/bin/env bash\n"
"export GH_URL=\"https://ghp_abcdefghijklmnopqrstuvwxyz1234567890@github.com/repo\"\n"
"export NORMAL_ENDPOINT=\"https://api.example.com/orders\"\n");

Expand All @@ -4692,10 +4692,10 @@ TEST(envscan_secret_file_exclusion) {

/* Secret file should be skipped */
write_temp_file(tmpdir, "credentials.sh",
"#!/bin/bash\nexport API_URL=\"https://api.example.com/v1\"\n");
"#!/usr/bin/env bash\nexport API_URL=\"https://api.example.com/v1\"\n");
/* Normal file should be scanned */
write_temp_file(tmpdir, "setup.sh",
"#!/bin/bash\nexport API_URL=\"https://api.example.com/v1\"\n");
"#!/usr/bin/env bash\nexport API_URL=\"https://api.example.com/v1\"\n");

cbm_env_binding_t bindings[32];
int count = cbm_scan_project_env_urls(tmpdir, bindings, 32);
Expand Down Expand Up @@ -4727,7 +4727,7 @@ TEST(envscan_skips_ignored_dirs) {
snprintf(gitdir, sizeof(gitdir), "%s/.git", tmpdir);
cbm_mkdir(gitdir);
write_temp_file(tmpdir, ".git/config.sh",
"#!/bin/bash\nexport API_URL=\"https://api.example.com/v1\"\n");
"#!/usr/bin/env bash\nexport API_URL=\"https://api.example.com/v1\"\n");

/* File inside node_modules should be skipped */
char nmdir[512];
Expand All @@ -4737,11 +4737,11 @@ TEST(envscan_skips_ignored_dirs) {
snprintf(nmpkg, sizeof(nmpkg), "%s/node_modules/pkg", tmpdir);
cbm_mkdir(nmpkg);
write_temp_file(tmpdir, "node_modules/pkg/config.sh",
"#!/bin/bash\nexport API_URL=\"https://api.example.com/v1\"\n");
"#!/usr/bin/env bash\nexport API_URL=\"https://api.example.com/v1\"\n");

/* File at root level should be scanned */
write_temp_file(tmpdir, "deploy.sh",
"#!/bin/bash\nexport API_URL=\"https://api.example.com/v1\"\n");
"#!/usr/bin/env bash\nexport API_URL=\"https://api.example.com/v1\"\n");

cbm_env_binding_t bindings[32];
int count = cbm_scan_project_env_urls(tmpdir, bindings, 32);
Expand Down Expand Up @@ -4776,7 +4776,7 @@ TEST(envscan_non_url_values_skipped) {
"ENV DEBUG=true\n"
"ENV LOG_LEVEL=info\n");
write_temp_file(tmpdir, "config.sh",
"#!/bin/bash\n"
"#!/usr/bin/env bash\n"
"export REGION=\"us-east-1\"\n"
"export COUNT=42\n");

Expand Down
Loading