make cdist-manifest-run change the working dir

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-02-24 09:37:31 +01:00
commit 57c60a40a8
3 changed files with 10 additions and 11 deletions

View file

@ -23,12 +23,13 @@
#
. cdist-config
[ $# -ge 3 ] || __cdist_usage "<target host> <manifest> <outdir> [manifest arguments]"
[ $# -ge 4 ] || __cdist_usage "<target host> <work dir> <manifest> <out dir> [manifest arguments]"
set -u
export __cdist_target_host="$1"; shift
export __cdist_manifest="$1"; shift
export __cdist_output_dir="$1"; shift
__cdist_target_host="$1"; shift
__cdist_work_dir="$1"; shift
__cdist_manifest="$1"; shift
__cdist_output_dir="$1"; shift
# Ensure binaries exist and are up-to-date
cdist-type-build-emulation || __cdist_exit_err "Failed to build type emulation binaries"
@ -43,4 +44,5 @@ fi
mkdir -p "${__cdist_output_dir}" || __cdist_exit_err "Cannot create output dir ${__cdist_output_dir}"
cd "$__cdist_work_dir" || __cdist_exit_err "Cannot change to work dir \"$__cdist_work_dir\"."
__cdist_exec_fail_on_error "${__cdist_manifest}" "$@"