One bug fix, one removal of an unnecessary cat.

This commit is contained in:
Simon Gomizelj 2011-11-28 21:28:02 -05:00 committed by Evan LeCompte (Home)
commit bfe6d22bda

View file

@ -24,7 +24,7 @@ sprunge () {
local url syntax local url syntax
if [[ -t 0 ]]; then if [[ -t 0 ]]; then
if [[ "$*" ]]; then if [[ -n "$*" ]]; then
if [[ -f "$*" ]]; then if [[ -f "$*" ]]; then
# Use python to attempt to detect the syntax # Use python to attempt to detect the syntax
syntax=$(echo "try: syntax=$(echo "try:
@ -32,7 +32,7 @@ sprunge () {
print(get_lexer_for_filename('$*').aliases[0]) print(get_lexer_for_filename('$*').aliases[0])
except: except:
print('text')" | python) print('text')" | python)
url=$(cat "$*" | curl -F 'sprunge=<-' http://sprunge.us) url=$(curl -F 'sprunge=<-' http://sprunge.us < "$*")
fi fi
else else
cat << HERE cat << HERE