MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / sh_mentions_deploy_tool

Function sh_mentions_deploy_tool

src/pipeline/pass_shell.c:2784–2804  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2782/* ── Files ─────────────────────────────────────────────────────────── */
2783
2784static bool sh_mentions_deploy_tool(const char *src, size_t n) {
2785 static const char *const tools[] = {"kubectl", "helm", "kustomize", "docker",
2786 "podman", "buildah", "nerdctl"};
2787 for (size_t i = 0; i < n; i++) {
2788 char c = src[i] | ' ';
2789 if (!strchr("khdpbn", c)) {
2790 continue;
2791 }
2792 for (size_t t = 0; t < sizeof(tools) / sizeof(tools[0]); t++) {
2793 size_t tl = strlen(tools[t]);
2794 size_t j = 0;
2795 while (j < tl && i + j < n && (src[i + j] | ' ') == tools[t][j]) {
2796 j++;
2797 }
2798 if (j == tl) {
2799 return true;
2800 }
2801 }
2802 }
2803 return false;
2804}
2805
2806static char *sh_read(const char *path, size_t *len) {
2807 FILE *f = cbm_fopen(path, "rb");

Callers 1

sh_makefileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected