Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

make curl fail on errors

  • Loading branch information...
commit 401e48b926cddce163065592a534957910bf8d53 1 parent 56f4771
@ddollar authored
Showing with 10 additions and 10 deletions.
  1. +5 −5 bin/compile
  2. +4 −4 bin/fetch
  3. +1 −1  bin/stow
View
10 bin/compile
@@ -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)
@@ -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
;;
*)
@@ -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 .
@@ -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
View
8 bin/fetch
@@ -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)
@@ -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
View
2  bin/stow
@@ -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}"
Please sign in to comment.
Something went wrong with that request. Please try again.