-
-
Save giladbarnea/dc7fc01e3a101f8da7ef62354e550c65 to your computer and use it in GitHub Desktop.
rf | robust-fetch executable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env -S bash | |
| typeset -a args | |
| typeset cache_result=false | |
| while [[ $# -gt 0 ]]; do | |
| case "$1" in | |
| --cache) cache_result=true ;; | |
| *) args+=("$1") ;; | |
| esac | |
| shift | |
| done | |
| if [[ $cache_result = true ]]; then | |
| if command -v cached >/dev/null 2>&1; then | |
| echo "[rf][INFO] Caching invocation" 1>&2 | |
| cached ~/.claude/skills/robust-fetch/scripts/robust_fetch.py "${args[@]}" | |
| else | |
| echo "[rf][WARNING] ‘cached’ command not found. Will run the command without caching. Try running this script via ‘FORCE_OMZ=1 /bin/zsh -ic 'rf ...'’. " 1>&2 | |
| ~/.claude/skills/robust-fetch/scripts/robust_fetch.py "${args[@]}" | |
| fi | |
| else | |
| ~/.claude/skills/robust-fetch/scripts/robust_fetch.py "${args[@]}" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment