From 8a2f3cbd88709c5b349ffb3f915f3ae1bf93a7ae Mon Sep 17 00:00:00 2001 From: Andrew Plummer Date: Thu, 22 Apr 2021 12:55:52 +0100 Subject: [PATCH] Lint utility: even more thorough tidying (#21) --- tools/lint.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/lint.sh b/tools/lint.sh index 7c0f44d..dab1a6a 100755 --- a/tools/lint.sh +++ b/tools/lint.sh @@ -1,5 +1,15 @@ #!/bin/bash -ex -docker run --rm -it -v $(pwd):/repo --workdir /repo quay.io/helmpack/chart-testing ct lint --config ct.yaml "$@" -# Tidy up any generated sub-charts directories, which will be owned by root because of the docker container -docker run --rm -it -v $(pwd):/repo --workdir /repo quay.io/helmpack/chart-testing sh -c 'rm -rf charts/**/charts' +cleanup() { + # Tidy up any generated sub-charts directories, which will be owned by root because of the docker container + echo "CLEANING UP" + docker run --rm -it -v $(pwd):/repo --workdir /repo quay.io/helmpack/chart-testing sh -c 'rm -rf charts/**/charts && rm -rf charts/**/tmpcharts' +} + +main() { + trap cleanup EXIT + cleanup + docker run --rm -it -v $(pwd):/repo --workdir /repo quay.io/helmpack/chart-testing ct lint --config ct.yaml "$@" +} + +main "$@"