Skip to content

Commit 9346c5b

Browse files
committed
Fix results upload to external service
1 parent d23ad80 commit 9346c5b

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

reconftw.sh

+4-8
Original file line numberDiff line numberDiff line change
@@ -5113,22 +5113,18 @@ function transfer {
51135113
echo "No arguments specified.\nUsage:\n transfer <file|directory>\n ... | transfer <file_name>" >&2
51145114
return 1
51155115
fi
5116+
51165117
if tty -s; then
51175118
file="$1"
51185119
file_name=$(basename "$file")
51195120
if [[ ! -e $file ]]; then
51205121
echo "$file: No such file or directory" >&2
51215122
return 1
51225123
fi
5123-
if [[ -d $file ]]; then
5124-
file_name="$file_name.zip"
5125-
(cd "$file" && zip -r -q - .) | curl --progress-bar --upload-file "-" "https://oshi.at/${file_name}" | tee /dev/null
5126-
else
5127-
cat "$file" | curl --progress-bar --upload-file "-" "https://oshi.at/${file_name}" | tee /dev/null
5128-
fi
5124+
tar -czvf /tmp/$file_name $file > /dev/null 2>&1 && curl -s https://bashupload.com/$file.tgz --data-binary @/tmp/$file_name | grep wget
51295125
else
51305126
file_name=$1
5131-
curl --progress-bar --upload-file "-" "https://oshi.at/${file_name}" | tee /dev/null
5127+
tar -czvf /tmp/$file_name $file > /dev/null 2>&1 && curl -s https://bashupload.com/$file.tgz --data-binary @/tmp/$file_name | grep wget
51325128
fi
51335129
}
51345130

@@ -5140,7 +5136,7 @@ function sendToNotify {
51405136
NOTIFY_CONFIG=~/.config/notify/provider-config.yaml
51415137
fi
51425138
if [[ -n "$(find "${1}" -prune -size +8000000c)" ]]; then
5143-
printf '%s is larger than 8MB, sending over oshi.at\n' "${1}"
5139+
printf '%s is larger than 8MB, sending over external service\n' "${1}"
51445140
transfer "${1}" | notify -silent
51455141
return 0
51465142
fi

0 commit comments

Comments
 (0)