dockerfile-parser-rs 3.3.0

The ultimate Rust library for parsing, modifying, and generating Dockerfiles
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::ast::Instruction;
use crate::parser::utils::clean_exec_form;
use crate::parser::utils::clean_shell_form;
use crate::parser::utils::is_exec_form;

pub fn parse(arguments: &[String]) -> Instruction {
    let mounts = if is_exec_form(arguments) {
        clean_exec_form(arguments)
    } else {
        clean_shell_form(arguments)
    };

    Instruction::Volume { mounts }
}