From c153e052583fecc39f2cac9c40f99218e2e70c41 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 21 Mar 2025 18:07:17 -0400 Subject: Fixes for ask() being optional and command success status --- examples/commands/commands.tm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'examples') diff --git a/examples/commands/commands.tm b/examples/commands/commands.tm index c70d8592..7d2f4a6f 100644 --- a/examples/commands/commands.tm +++ b/examples/commands/commands.tm @@ -33,6 +33,12 @@ struct ProgramResult(stdout:[Byte], stderr:[Byte], exit_type:ExitType): else: return none return none + func succeeded(r:ProgramResult -> Bool): + when r.exit_type is Exited(status): + return (status == 0) + else: + return no + 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) -- cgit v1.2.3