diff options
Diffstat (limited to 'scripts/guix-retry')
-rwxr-xr-x | scripts/guix-retry | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/guix-retry b/scripts/guix-retry new file mode 100755 index 0000000..c504048 --- /dev/null +++ b/scripts/guix-retry @@ -0,0 +1,21 @@ +#!/bin/sh + +error="write_to_session_record_port" + +# create redirection +# file descripters +exec 11>&1 # stdout +exec 22>&2 # stderr + +while true; do + # send stdout to stdout + # send stderr though pipe + output=$("$@" 2>&1 1>&11 | tee >(cat - >&22)) # return stderr to + # normal stderr as well + + # check if error is in stderr + if echo "$output" | grep -q "$error"; then + continue + fi + break +done |