Skip to content

Instantly share code, notes, and snippets.

@joefiorini
Created December 2, 2016 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joefiorini/ca4e3443cb0d16646832b412974f9530 to your computer and use it in GitHub Desktop.
Save joefiorini/ca4e3443cb0d16646832b412974f9530 to your computer and use it in GitHub Desktop.
#!/usr/bin/env fish
clear
set -l num_runs 0
while true;
echo "Executing: $argv"
eval "$argv"
set cmd_status $status
set num_runs (math "$num_runs+1")
if test $cmd_status -ne 0
echo ""
echo " ❎ failed after $num_runs tries"
echo ""
break
end
echo ""
echo " ✅ succeeded, retrying..."
echo ""
sleep 2
clear
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment