forked from ungleich-public/cdist
shrink cdist env and make it usable for . ./bin/cdist-env (in sh)
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
29edf58809
commit
8a76143e33
1 changed files with 7 additions and 17 deletions
|
@ -21,23 +21,13 @@
|
||||||
# Setup environment for use with cdist - must be standalone!
|
# Setup environment for use with cdist - must be standalone!
|
||||||
#
|
#
|
||||||
|
|
||||||
__cdist_pwd="$(pwd -P)"
|
export PATH="$(cd "${0%/*}" && pwd -P):$PATH"
|
||||||
__cdist_mydir="${0%/*}";
|
export MANPATH="$(cd "${0%/*}/../doc/man" && pwd -P):$MANPATH"
|
||||||
__cdist_abs_mydir="$(cd "$__cdist_mydir" && pwd -P)"
|
|
||||||
__cdist_myname=${0##*/};
|
|
||||||
__cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname"
|
|
||||||
|
|
||||||
shell_binary=${SHELL##*/}
|
if [ "$(echo ${SHELL##*/} | grep 'csh$')" ]; then
|
||||||
|
echo setenv PATH $PATH \;
|
||||||
NEWPATH="$__cdist_abs_mydir:$PATH"
|
echo setenv MANPATH $MANPATH
|
||||||
cd "$__cdist_abs_mydir/../doc/man"
|
|
||||||
NEWMANPATH="$(pwd -P):$MANPATH"
|
|
||||||
|
|
||||||
# Match csh, tcsh to handle differently
|
|
||||||
if [ "$(echo $shell_binary | grep 'csh$')" ]; then
|
|
||||||
echo setenv PATH $NEWPATH \;
|
|
||||||
echo setenv MANPATH $NEWMANPATH
|
|
||||||
else
|
else
|
||||||
echo export PATH=$NEWPATH
|
echo export PATH=$PATH
|
||||||
echo export MANPATH=$NEWMANPATH
|
echo export MANPATH=$MANPATH
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue