A chart directory: its Chart. */
| 1270 | |
| 1271 | /* A chart directory: its Chart. */ |
| 1272 | static int sh_t_chart(sh_t *s, const char *dir, const sh_find_t *f, sh_targets_t *out) { |
| 1273 | (void)f; |
| 1274 | static const char *const names[] = {"Chart.yaml", "Chart.yml"}; |
| 1275 | for (size_t i = 0; i < sizeof(names) / sizeof(names[0]); i++) { |
| 1276 | const char *p = cbm_arena_sprintf(s->a, "%s%s%s", dir, dir[0] ? "/" : "", names[i]); |
| 1277 | const char *key = p ? cbm_ht_get_key(s->ix->charts, p) : NULL; |
| 1278 | if (key) { |
| 1279 | sh_targets_push(out, (int64_t)(intptr_t)cbm_ht_get(s->ix->charts, key), dir); |
| 1280 | return SKIP_ONE; |
| 1281 | } |
| 1282 | } |
| 1283 | return 0; |
| 1284 | } |
| 1285 | |
| 1286 | /* Where `cd v` lands: *out = AT an existing directory, else LOST. */ |
| 1287 | static const char *sh_cd_target(sh_t *s, const char *v, sh_cwd_t *out) { |
nothing calls this directly
no test coverage detected