Skip to content

Commit

Permalink
fix getRemoteFile() to correctly use tmpdir
Browse files Browse the repository at this point in the history
  • Loading branch information
nickboldt committed Mar 9, 2015
1 parent 5778a73 commit 49b8498
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions publish/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ getRemoteFile ()
{
# requires $wgetParams and $tmpdir to be defined (above)
getRemoteFileReturn=""
URL="$1"
output=`mktemp getRemoteFile.XXXXXX`
if [[ ! `wget ${wgetParams} ${URL} -O ${tmpdir}/${output} 2>&1 | egrep "ERROR 404"` ]]; then # file downloaded
getRemoteFileReturn=${tmpdir}/${output}
grfURL="$1"
output=`mktemp --tmpdir=${tmpdir} getRemoteFile.XXXXXX`
if [[ ! `wget ${wgetParams} ${grfURL} -O ${output} 2>&1 | egrep "ERROR 404"` ]]; then # file downloaded
getRemoteFileReturn=${output}
else
getRemoteFileReturn=""
rm -f ${tmpdir}/${output}
rm -f ${output}
fi
}

Expand Down

0 comments on commit 49b8498

Please sign in to comment.