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

Function sh_deploy_command

src/pipeline/pass_shell.c:1738–1766  ·  view source on GitHub ↗

One command of a pipeline (or a lone one): its deploys; *out: what it * writes to the pipe, when that is a kustomize build or a helm template. */

Source from the content-addressed store, hash-verified

1736/* One command of a pipeline (or a lone one): its deploys; *out: what it
1737 * writes to the pipe, when that is a kustomize build or a helm template. */
1738static void sh_deploy_command(sh_t *s, TSNode cmd, const sh_argv_t *a, const sh_src_t *in,
1739 sh_src_t *out) {
1740 *out = (sh_src_t){SH_SRC_NONE, NULL, NULL};
1741 int prog = sh_program(s, a);
1742 if (prog < 0 || !a->v[prog]) {
1743 return;
1744 }
1745 const char *base = sh_basename(a->v[prog]);
1746 if (strcmp(base, "kubectl") == 0) {
1747 sh_kubectl(s, cmd, a, prog, in, out);
1748 } else if (strcmp(base, "helm") == 0) {
1749 sh_helm(s, cmd, a, prog, out);
1750 } else if (strcmp(base, "kustomize") == 0) {
1751 const char *verb = sh_first_operand(a, prog + SKIP_ONE);
1752 if (sh_eq(verb, "build")) {
1753 int at = SH_NO_DEPTH;
1754 for (int i = prog + SKIP_ONE; i < a->n; i++) {
1755 if (a->v[i] == verb) {
1756 at = i;
1757 break;
1758 }
1759 }
1760 const char *d = at >= 0 ? sh_first_operand(a, at + SKIP_ONE) : NULL;
1761 *out = (sh_src_t){SH_SRC_KUST, d ? d : ".", "kustomize"};
1762 }
1763 } else if (strcmp(base, "find") == 0) {
1764 sh_find(s, cmd, a, prog);
1765 }
1766}
1767
1768/* The File node a repository path names; 0: none. */
1769static int64_t sh_repo_file_id(const sh_t *s, const char *path) {

Callers 2

sh_commandFunction · 0.85
sh_pipe_runFunction · 0.85

Calls 7

sh_programFunction · 0.85
sh_basenameFunction · 0.85
sh_kubectlFunction · 0.85
sh_helmFunction · 0.85
sh_first_operandFunction · 0.85
sh_eqFunction · 0.85
sh_findFunction · 0.85

Tested by

no test coverage detected