-module(go_over@util@util). -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). -export([hard_fail/2, retry_cmd/2]). -file("/home/bwireman/src/go-over/src/go_over/util/util.gleam", 5). -spec hard_fail({ok, VAJ} | {error, any()}, binary()) -> VAJ. hard_fail(Res, Msg) -> case Res of {ok, Val} -> Val; _ -> go_over@util@print:warning(<<"Error: "/utf8, Msg/binary>>), shellout_ffi:os_exit(1), erlang:error(#{gleam_error => panic, message => <<"Unreachable, please create an issue in https://github.com/bwireman/go-over if you see this"/utf8>>, module => <<"go_over/util/util"/utf8>>, function => <<"hard_fail"/utf8>>, line => 11}) end. -file("/home/bwireman/src/go-over/src/go_over/util/util.gleam", 16). -spec retry_cmd(binary(), list(binary())) -> {ok, binary()} | {error, {integer(), binary()}}. retry_cmd(Cmd, Args) -> _pipe = delay:delay_effect( fun() -> shellout:command(Cmd, Args, <<"."/utf8>>, []) end ), _pipe@1 = delay:retry_with_backoff(_pipe, 3), delay:run(_pipe@1).