OCaml: Apply formatting
This commit is contained in:
parent
ce3859f62c
commit
bb1cd19000
12 changed files with 145 additions and 74 deletions
|
|
@ -1,30 +1,34 @@
|
|||
let merge (schema: Schema.schema) (packages: string list): Schema.schema =
|
||||
|
||||
let merge (schema : Schema.schema) (packages : string list) : Schema.schema =
|
||||
match packages with
|
||||
| [] -> { schema with output = {
|
||||
schema.output with main = "No packages provided" }
|
||||
}
|
||||
| [] ->
|
||||
{
|
||||
schema with
|
||||
output = { schema.output with main = "No packages provided" };
|
||||
}
|
||||
| _ ->
|
||||
|
||||
let commands: Process.Command.command list = [
|
||||
{
|
||||
let commands : Process.Command.command list =
|
||||
[
|
||||
{
|
||||
name = "doas";
|
||||
arguments = ["doas"; "apk"; "-i"; "add"] @ packages;
|
||||
arguments = [ "doas"; "apk"; "-i"; "add" ] @ packages;
|
||||
status = Unevaluated;
|
||||
};
|
||||
{
|
||||
};
|
||||
{
|
||||
name = "doas";
|
||||
arguments = ["doas"; "apk"; "-i"; "del"] @ packages;
|
||||
arguments = [ "doas"; "apk"; "-i"; "del" ] @ packages;
|
||||
status = Unevaluated;
|
||||
}
|
||||
] in
|
||||
};
|
||||
]
|
||||
in
|
||||
|
||||
let ran = Process.Fork.run_many commands in
|
||||
let formatted_ran = Process.Command.format_many ran in
|
||||
|
||||
{
|
||||
schema with output = {
|
||||
schema.output with log =
|
||||
"Done:\n" ^ (String.concat "\n" formatted_ran)
|
||||
}
|
||||
schema with
|
||||
output =
|
||||
{
|
||||
schema.output with
|
||||
log = "Done:\n" ^ String.concat "\n" formatted_ran;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue