From b19a29be6e9928da729a3f9748906c777c033954 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 15 Mar 2011 21:30:02 +0100 Subject: [PATCH] make cdist-env usable standalone (i.e. without cdist-config) Signed-off-by: Nico Schottelius --- bin/cdist-env | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/cdist-env b/bin/cdist-env index e95e078b..a7610aac 100755 --- a/bin/cdist-env +++ b/bin/cdist-env @@ -18,14 +18,14 @@ # along with cdist. If not, see . # # -# Setup environment for use with cdist +# Setup environment for use with cdist - must be standalone! # -. cdist-config -[ $# -eq 0 ] || __cdist_usage "no arguments" - -# Allow access to unset variables like PATH and MANPATH -set +u +__cdist_pwd="$(pwd -P)" +__cdist_mydir="${0%/*}"; +__cdist_abs_mydir="$(cd "$__cdist_mydir" && pwd -P)" +__cdist_myname=${0##*/}; +__cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" echo export PATH=$__cdist_abs_mydir:$PATH