This commit is contained in:
Michael Vines 2018-07-26 11:38:26 -07:00 committed by Grimes
parent 42ebf9502a
commit ab3968e3bf
1 changed files with 10 additions and 22 deletions

View File

@ -55,28 +55,16 @@ else
# NOTE: this will be horribly broken if we ever decide to run multiple # NOTE: this will be horribly broken if we ever decide to run multiple
# agents on the same machine. # agents on the same machine.
( (
cd .. || exit 1 for keepDir in "$BUILDKITE_PIPELINE_SLUG" \
for dir in *; do "$BUILDKITE_ORGANIZATION_SLUG" \
if [[ -d $dir && $dir != "$BUILDKITE_PIPELINE_SLUG" ]]; then "$BUILDKITE_AGENT_NAME"; do
echo "Removing $dir" cd .. || exit 1
rm -rf "${dir:?}"/ for dir in *; do
fi if [[ -d $dir && $dir != "$keepDir" ]]; then
done echo "Removing $dir"
rm -rf "${dir:?}"/
cd .. || exit 1 fi
for dir in *; do done
if [[ -d $dir && $dir != "$BUILDKITE_ORGANIZATION_SLUG" ]]; then
echo "Removing $dir"
rm -rf "${dir:?}"/
fi
done
cd .. || exit 1
for dir in *; do
if [[ -d $dir && $dir != "$BUILDKITE_AGENT_NAME" ]]; then
echo "Removing $dir"
rm -rf "${dir:?}"/
fi
done done
) )
fi fi