Use curl instead of wget, avoiding busyboxisms on Alpine

This commit is contained in:
Tony Garnock-Jones 2018-12-24 11:35:06 +00:00
parent aebf989e8d
commit 5de93f6942
1 changed files with 9 additions and 3 deletions

View File

@ -20,14 +20,20 @@ case "$1" in
redo-ifchange "src/$file" redo-ifchange "src/$file"
if [ -n "$SYNDICATE_COMPILE_SERVER" ] if [ -n "$SYNDICATE_COMPILE_SERVER" ]
then then
if wget -q -O - --content-on-error --post-file="src/$file" \ if curl -fs --data-binary "@src/$file" ${SYNDICATE_COMPILE_SERVER}/"$file" \
${SYNDICATE_COMPILE_SERVER}/"$file" \
> ${targettempfile} 2>/dev/null > ${targettempfile} 2>/dev/null
then then
: :
else else
cat ${targettempfile} >&2 # I can't figure out a way to get curl to both exit on
# error, and print the response body on error. So
# instead we try once, discarding the output but
# keeping the exit status, and if it fails, we try
# again, keeping the output but discarding the exit
# status.
curl -s --data-binary "@src/$file" ${SYNDICATE_COMPILE_SERVER}/"$file" >&2
rm -f ${targettempfile} rm -f ${targettempfile}
false
fi fi
else else
npx syndicate-babel "src/$file" npx syndicate-babel "src/$file"