Skip to content
This repository has been archived by the owner on Oct 26, 2018. It is now read-only.

Commit

Permalink
make curl fail on errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ddollar committed Nov 16, 2012
1 parent 56f4771 commit 401e48b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions bin/compile
Expand Up @@ -60,12 +60,12 @@ rm -rf $buildpack; mkdir -p $buildpack;
case $BUILDPACK_URL in
*.json)
buildpack_manifest=$(mktemp -t buildpack_manifest_XXXXX)
curl -s $BUILDPACK_URL -o $buildpack_manifest
curl -f -s $BUILDPACK_URL -o $buildpack_manifest
$root_dir/bin/download_manifest $buildpack_manifest $buildpack >/dev/null 2>&1
;;
*.tgz)
cd $buildpack
curl -s $BUILDPACK_URL -o- | tar xzf -
curl -f -s $BUILDPACK_URL -o- | tar xzf -
cd - >/dev/null 2>&1
;;
*.git)
Expand All @@ -81,7 +81,7 @@ case $BUILDPACK_URL in
*.sh|*.txt)
compile_script=$(mktemp -t compile_script_XXXXX)
cp -r $root_dir/data/buildpack-custom/* $buildpack/
curl -L -s $BUILDPACK_URL -o $buildpack/bin/script
curl -f -L -s $BUILDPACK_URL -o $buildpack/bin/script
chmod +x $buildpack/bin/script
;;
*)
Expand All @@ -102,7 +102,7 @@ buildpack_name=$($buildpack/bin/detect "$compile_dir") \
if [ "$CACHE_URL" != "" ]; then
echo -n "Fetching cache... "
cache=$(mktemp -t cache_XXXXX)
curl -s $CACHE_URL -o $cache
curl -f -s $CACHE_URL -o $cache
cd $cache_dir
tar xzf $cache >/dev/null 2>&1 && echo "done" || echo "empty"
cd .
Expand Down Expand Up @@ -154,7 +154,7 @@ if [ "$CACHE_URL" != "" ]; then
cd $cache_dir
tar czf $cache . >/dev/null 2>&1
cd .
code=$(curl -s -X PUT $CACHE_URL -F data=@$cache --write-out %{http_code} --silent --output /dev/null)
code=$(curl -f -s -X PUT $CACHE_URL -F data=@$cache --write-out %{http_code} --silent --output /dev/null)
if [ "$code" == "200" ]; then
echo "done"
else
Expand Down
8 changes: 4 additions & 4 deletions bin/fetch
Expand Up @@ -35,7 +35,7 @@ echo -n "Preparing app for compilation... " >&2
case $source_url in
*.json)
manifest=$(mktemp -t manifest_XXXXX)
curl -Ls $source_url -o $manifest
curl -f -Ls $source_url -o $manifest
$root_dir/bin/download_manifest $manifest $compile_dir >/dev/null
;;
*.git)
Expand All @@ -51,21 +51,21 @@ case $source_url in
;;
*.tar.gz|*.tgz)
tarball=$(mktemp -t tarball_XXXXX)
curl -Ls $source_url -o $tarball
curl -f -Ls $source_url -o $tarball
cd $compile_dir >/dev/null 2>&1
tar xzf $tarball
cd - >/dev/null 2>&1
;;
*.tar.bz2|*.tbz|*.tbz2)
tarball=$(mktemp -t tarball_XXXXX)
curl -Ls $source_url -o $tarball
curl -f -Ls $source_url -o $tarball
cd $compile_dir >/dev/null 2>&1
tar xjf $tarball
cd - >/dev/null 2>&1
;;
*.war)
war=$(mktemp -t war_XXXXX)
curl -Ls $source_url -o $war
curl -f -Ls $source_url -o $war
cd $compile_dir >/dev/null 2>&1
jar xf $war
cd - >/dev/null 2>&1
Expand Down
2 changes: 1 addition & 1 deletion bin/stow
Expand Up @@ -33,7 +33,7 @@ if [ "$SLUG_PUT_URL" != "" ]; then
echo "done"

echo -n "Uploading slug... "
curl -s -T $slug "$SLUG_PUT_URL"
curl -f -s -T $slug "$SLUG_PUT_URL"
echo "done"

echo "Success, slug is ${SLUG_URL}"
Expand Down

0 comments on commit 401e48b

Please sign in to comment.