Skip to content

Commit 2bb561e

Browse files
author
Chloe Hutchinson
committed
Check dir before deletion
1 parent 45a38c7 commit 2bb561e

File tree

2 files changed

+2
-2
lines changed
  • packer
    • linux/conf/buildkite-agent/hooks
    • windows/conf/buildkite-agent/hooks

2 files changed

+2
-2
lines changed

packer/linux/conf/buildkite-agent/hooks/pre-exit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -eu -o pipefail
44

55
# clean up our temporary docker config
6-
if [[ -n "${BUILDKITE_DOCKER_CONFIG_TEMP_DIRECTORY:-}" ]]; then
6+
if [[ -n "${BUILDKITE_DOCKER_CONFIG_TEMP_DIRECTORY:-}" && -d "$BUILDKITE_DOCKER_CONFIG_TEMP_DIRECTORY" ]]; then
77
rmdir "$BUILDKITE_DOCKER_CONFIG_TEMP_DIRECTORY"
88
fi
99

packer/windows/conf/buildkite-agent/hooks/pre-exit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -eu -o pipefail
44

55
# clean up our temporary docker config
6-
if [[ -n "${BUILDKITE_DOCKER_CONFIG_TEMP_DIRECTORY:-}" ]]; then
6+
if [[ -n "${BUILDKITE_DOCKER_CONFIG_TEMP_DIRECTORY:-}" && -d "$BUILDKITE_DOCKER_CONFIG_TEMP_DIRECTORY" ]]; then
77
rmdir "$BUILDKITE_DOCKER_CONFIG_TEMP_DIRECTORY"
88
fi
99

0 commit comments

Comments
 (0)