| 1098 | } |
| 1099 | |
| 1100 | static bool dk_interpreter(const char *base) { |
| 1101 | static const char *const NAMES[] = {"node", "php", "ruby", "perl", "bun", |
| 1102 | "deno", "bash", "sh", NULL}; |
| 1103 | for (int i = 0; NAMES[i]; i++) { |
| 1104 | if (strcmp(base, NAMES[i]) == 0) { |
| 1105 | return true; |
| 1106 | } |
| 1107 | } |
| 1108 | if (strncmp(base, "python", strlen("python")) != 0) { |
| 1109 | return false; |
| 1110 | } |
| 1111 | for (const char *p = base + strlen("python"); *p; p++) { |
| 1112 | if (!isdigit((unsigned char)*p) && *p != '.') { |
| 1113 | return false; |
| 1114 | } |
| 1115 | } |
| 1116 | return true; |
| 1117 | } |
| 1118 | |
| 1119 | /* SPAWNS from the Dockerfile to what its last stage runs. */ |
| 1120 | static void dk_spawn(dk_t *d) { |