From 34698417dd039f5b8abdbab251a85952f19b2e89 Mon Sep 17 00:00:00 2001 From: Quan TRAN Date: Tue, 11 Oct 2022 15:27:38 +0200 Subject: [PATCH] add .ct in current working-directory as config directory (#479) * add .ct in working as config directory Signed-off-by: Quan TRAN * Update README.md Signed-off-by: Quan TRAN Signed-off-by: Quan TRAN --- README.md | 2 +- pkg/config/config.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 63dcf9f..fdb7809 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ The following order of precedence applies: 1. Config file Note that linting requires config file for [yamllint](https://github.com/adrienverge/yamllint) and [yamale](https://github.com/23andMe/Yamale). -If not specified, these files are search in the current directory, `$HOME/.ct`, and `/etc/ct`, in that order. +If not specified, these files are search in the current directory, the `.ct` directory in current directory, `$HOME/.ct`, and `/etc/ct`, in that order. Samples are provided in the [etc](etc) folder. ### Examples diff --git a/pkg/config/config.go b/pkg/config/config.go index 916fbec..a020c7e 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -35,6 +35,7 @@ var ( homeDir, _ = homedir.Dir() configSearchLocations = []string{ ".", + ".ct", filepath.Join(homeDir, ".ct"), "/usr/local/etc/ct", "/etc/ct",