Command.from_path()

This commit is contained in:
Bruce Hill 2025-03-17 21:22:10 -04:00
parent 3873e806b0
commit 80ca0f0b1b

View File

@ -32,6 +32,9 @@ struct ProgramResult(stdout:[Byte], stderr:[Byte], exit_type:ExitType):
return none
struct Command(command:Text, args=[:Text], env={:Text,Text}):
func from_path(path:Path, args=[:Text], env={:Text,Text} -> Command):
return Command(Text(path), args, env)
func run(command:Command, input="", input_bytes=[:Byte] -> ProgramResult):
if input.length > 0:
(&input_bytes):insert_all(input:bytes())