Skip to content

Commit 50b6775

Browse files
author
Matthew Fisher
committed
fix(builder): silence clone on .download_buildpack()
If we supply a commit, we are expecting the first clone to error, since shallow clones do not accept commits. If there's a problem, it'll be captured in the second clone (--quiet only silences stdout, not stderr).
1 parent a716eed commit 50b6775

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

builder/image/slugbuilder/builder/install-buildpacks

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,22 @@ download_buildpack() {
88
buildpack_name=$(basename $buildpack_url)
99
buildpack_commit="$2"
1010

11+
echo "Fetching $buildpack_name..."
12+
1113
set +e
12-
git clone --branch $buildpack_commit --depth 1 $buildpack_url $BUILDPACK_INSTALL_PATH/$buildpack_name
14+
git clone --branch $buildpack_commit --depth 1 $buildpack_url $BUILDPACK_INSTALL_PATH/$buildpack_name &>/dev/null
1315
SHALLOW_CLONED=$?
1416
set -e
1517
if [ $SHALLOW_CLONED -ne 0 ]; then
1618
# if the shallow clone failed partway through, clean up and try a full clone
1719
rm -rf $BUILDPACK_INSTALL_PATH/$buildpack_name
18-
git clone $buildpack_url $BUILDPACK_INSTALL_PATH/$buildpack_name
20+
git clone --quiet $buildpack_url $BUILDPACK_INSTALL_PATH/$buildpack_name
1921
pushd $BUILDPACK_INSTALL_PATH/$buildpack_name &>/dev/null
2022
git checkout --quiet $buildpack_commit
2123
popd &>/dev/null
2224
fi
2325

26+
echo "Done."
2427
}
2528

2629
mkdir -p $BUILDPACK_INSTALL_PATH

0 commit comments

Comments
 (0)