Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f21011a

Browse files
author
Takashi Matsuo
committed
remove the tmpdir at the end
1 parent e38206a commit f21011a

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.kokoro/trampoline_v2.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,15 @@ function log_red() {
8888
log_impl "${IO_COLOR_RED}" "$@"
8989
}
9090

91+
readonly tmpdir=$(mktemp -d -t ci-XXXXXXXX)
92+
readonly tmphome="${tmpdir}/h"
93+
mkdir -p "${tmphome}"
94+
95+
function cleanup() {
96+
rm -rf "${tmpdir}"
97+
}
98+
trap cleanup EXIT
99+
91100
function repo_root() {
92101
local dir="$1"
93102
while [[ ! -d "${dir}/.git" ]]; do
@@ -96,10 +105,6 @@ function repo_root() {
96105
echo "${dir}"
97106
}
98107

99-
readonly tmpdir=$(mktemp -d -t ci-XXXXXXXX)
100-
readonly tmphome="${tmpdir}/h"
101-
mkdir -p "${tmphome}"
102-
103108
PROGRAM_PATH="$(realpath "$0")"
104109
PROGRAM_DIR="$(dirname "${PROGRAM_PATH}")"
105110
PROJECT_ROOT="$(repo_root "${PROGRAM_DIR}")"

0 commit comments

Comments
 (0)