From b6f6419423fc372a5e0a039153ff24b203ef8d8f Mon Sep 17 00:00:00 2001 From: Christoph Blecker Date: Mon, 4 Sep 2017 11:04:09 -0700 Subject: [PATCH] make clean will remove all gitignored files --- .gitignore | 3 +++ build/common.sh | 6 ++++-- build/root/Makefile | 5 +---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 0d25318ac1851..aad2fb8ba2916 100644 --- a/.gitignore +++ b/.gitignore @@ -120,5 +120,8 @@ zz_generated.openapi.go # This file used by some vendor repos (e.g. github.com/go-openapi/...) to store secret variables and should not be ignored !\.drone\.sec +# Godeps workspace +/Godeps/_workspace + /bazel-* *.pyc diff --git a/build/common.sh b/build/common.sh index eb15466fa8516..b422bd3e35ac6 100755 --- a/build/common.sh +++ b/build/common.sh @@ -409,8 +409,10 @@ function kube::build::clean() { "${DOCKER[@]}" rmi $("${DOCKER[@]}" images -q --filter 'dangling=true') 2> /dev/null || true fi - kube::log::status "Removing _output directory" - rm -rf "${LOCAL_OUTPUT_ROOT}" + if [[ -d "${LOCAL_OUTPUT_ROOT}" ]]; then + kube::log::status "Removing _output directory" + rm -rf "${LOCAL_OUTPUT_ROOT}" + fi } # Set up the context directory for the kube-build image and build it. diff --git a/build/root/Makefile b/build/root/Makefile index b0c59bf24f291..ffed29909cd43 100644 --- a/build/root/Makefile +++ b/build/root/Makefile @@ -309,10 +309,7 @@ clean: else clean: clean_meta build/make-clean.sh - rm -rf $(OUT_DIR) - rm -rf Godeps/_workspace # Just until we are sure it is gone - # TODO(thockin): Remove this when we call clean_generated. - rm -f pkg/generated/openapi/zz_generated.openapi.go + git clean -Xdf endif define CLEAN_META_HELP_INFO