-
-
Save agumonkey/b85cef0874822c470cc6 to your computer and use it in GitHub Desktop.
curl wrapper to only pipe text mime type to stdout, the rest to the filesystem
This file contains 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 sh | |
case $(curl -sLI $1 | grep -i content-type) in | |
*text*) echo "curl $1" | |
;; | |
*) echo "curl $1 > $(basename $1)" | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tests