From 13a79986ea4a93ea76a39ef0f52e3c4e86b33197 Mon Sep 17 00:00:00 2001 From: Bruno Tavares Date: Mon, 17 Mar 2014 15:09:41 -0300 Subject: [PATCH] Remove user and OS dependency for figuring out the profile paths --- kickstart/recipes/kickstart/profile.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/kickstart/recipes/kickstart/profile.sh b/kickstart/recipes/kickstart/profile.sh index b468d3e..d5adde9 100644 --- a/kickstart/recipes/kickstart/profile.sh +++ b/kickstart/recipes/kickstart/profile.sh @@ -19,14 +19,13 @@ kickstart.profile.source_on_configuration_file() { } kickstart.profile.location.profile_d() { - kickstart.os.is Ubuntu && echo /etc/profile.d - kickstart.os.is Mac && echo ~/.profile.d + [ -w /etc -o -w /etc/profile.d ] && echo /etc/profile.d || echo ~/.profile.d } kickstart.profile.location.zsh() { - [ `whoami` = root ] && echo /etc/zshenv || echo ~/.zshenv + [ -w /etc ] && echo /etc/zshenv || echo ~/.zshenv } kickstart.profile.location.bash() { - [ `whoami` = root ] && echo /etc/profile || echo ~/.bashrc + [ -w /etc ] && echo /etc/profile || echo ~/.bashrc }