| 1410 | } |
| 1411 | |
| 1412 | static void dk_file(dk_t *d, TSNode root) { |
| 1413 | for (uint32_t i = 0; i < ts_node_named_child_count(root); i++) { |
| 1414 | TSNode ins = ts_node_named_child(root, i); |
| 1415 | if (dk_type(ins, "arg_instruction")) { |
| 1416 | dk_arg(d, ins); |
| 1417 | } else if (dk_type(ins, "env_instruction")) { |
| 1418 | dk_env(d, ins); |
| 1419 | } else if (dk_type(ins, "from_instruction")) { |
| 1420 | dk_from(d, ins); |
| 1421 | } else if ((dk_type(ins, "copy_instruction") || dk_type(ins, "add_instruction")) && |
| 1422 | d->stage >= 0) { |
| 1423 | dk_copy(d, ins); |
| 1424 | } else if (dk_type(ins, "workdir_instruction") && d->stage >= 0) { |
| 1425 | dk_workdir(d, ins); |
| 1426 | } else if (dk_type(ins, "run_instruction") && d->stage >= 0) { |
| 1427 | dk_run(d, ins); |
| 1428 | } else if (dk_type(ins, "entrypoint_instruction") && d->stage >= 0) { |
| 1429 | dk_entry(d, ins, &d->entry); |
| 1430 | } else if (dk_type(ins, "cmd_instruction") && d->stage >= 0) { |
| 1431 | dk_entry(d, ins, &d->cmd); |
| 1432 | } |
| 1433 | } |
| 1434 | dk_spawn(d); |
| 1435 | dk_envs(d); |
| 1436 | dk_image_set(d); |
| 1437 | } |
| 1438 | |
| 1439 | static char *dk_read(const char *path, size_t *len) { |
| 1440 | FILE *f = cbm_fopen(path, "rb"); |
no test coverage detected