diff options
Diffstat (limited to '.ci/local')
-rwxr-xr-x | .ci/local/test.sh | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/.ci/local/test.sh b/.ci/local/test.sh index 43b9bbb..e7cd2c7 100755 --- a/.ci/local/test.sh +++ b/.ci/local/test.sh @@ -2,18 +2,27 @@ set -o errexit -o nounset -o pipefail -readonly local_repo_path="$HOME/test_repo" +local_repo_path= readonly cgitize_conf_path="$HOME/etc/cgitize/cgitize.conf" readonly my_repos_path="$HOME/etc/cgitize/my_repos.py" readonly output_path="$HOME/var/cgitize/output" +cleanup() { + echo + echo ---------------------------------------------------------------------- + echo Cleaning up + echo ---------------------------------------------------------------------- + + rm -rf -- "$local_repo_path" +} + setup_local_repo() { echo echo ---------------------------------------------------------------------- echo Setting up upstream repository echo ---------------------------------------------------------------------- - mkdir -p -- "$local_repo_path" + local_repo_path="$( mktemp -d )" pushd -- "$local_repo_path" > /dev/null git init @@ -60,7 +69,7 @@ from cgitize.repo import Repo MY_REPOS = ( - Repo('test_repo', clone_url='$HOME/test_repo'), + Repo('test_repo', clone_url='$local_repo_path'), ) EOF } @@ -97,6 +106,7 @@ verify() { } main() { + trap cleanup EXIT setup run verify |