summaryrefslogtreecommitdiff
path: root/habitat
diff options
context:
space:
mode:
authorNathan Cerny <ncerny@gmail.com>2019-05-29 09:31:29 -0500
committerNathan Cerny <ncerny@gmail.com>2019-05-29 09:40:36 -0500
commitb4a5cc4ecb9545ff0ce20d81e3217d1909f916d6 (patch)
tree970d7d2b10a9e9351d13de783b2ab88072c59b64 /habitat
parente324a787b6bd7c4ad8aa2d6de2395f6965b0bdd8 (diff)
downloadchef-b4a5cc4ecb9545ff0ce20d81e3217d1909f916d6.tar.gz
Allow config file name to flex for nonstandard file names.
Signed-off-by: Nathan Cerny <ncerny@gmail.com>
Diffstat (limited to 'habitat')
-rw-r--r--habitat/hooks/run6
1 files changed, 5 insertions, 1 deletions
diff --git a/habitat/hooks/run b/habitat/hooks/run
index c6e7f64c6e..598d609d7f 100644
--- a/habitat/hooks/run
+++ b/habitat/hooks/run
@@ -9,4 +9,8 @@ else
CLIENT_CONFIG="{{cfg.config_path}}"
fi
-exec chef-client --fork -c ${CLIENT_CONFIG}/client.rb --chef-license {{cfg.chef_license}}
+if [[ "${CLIENT_CONFIG##*.}" != "rb" ]]; then
+ CLIENT_CONFIG=${CLIENT_CONFIG}/client.rb
+fi
+
+exec chef-client --fork -c ${CLIENT_CONFIG} --chef-license {{cfg.chef_license}}