diff --git a/bin/cdist-code-run b/bin/cdist-code-run index 5fdcce4e..3d7499bf 100755 --- a/bin/cdist-code-run +++ b/bin/cdist-code-run @@ -32,19 +32,19 @@ if [ ! -d "$(__cdist_object_dir "$__cdist_object_self")" ]; then __cdist_exit_err "Object undefined" fi -code="$(__cdist_object_code "$__cdist_object_self" "${__cdist_code_type}")" +__cdist_code="$(__cdist_object_code "$__cdist_object_self" "${__cdist_code_type}")" __cdist_echo info "Checking code-${__cdist_code_type}" -if [ -e "$code" ]; then - if [ -f "$code" ]; then - if [ -x "$code" ]; then +if [ -e "$__cdist_code" ]; then + if [ -f "$__cdist_code" ]; then + if [ -x "$__cdist_code" ]; then __cdist_echo info "Executing code-${__cdist_code_type}" - __cdist_exec_fail_on_error "$code" + __cdist_exec_fail_on_error "$__cdist_code" else - __cdist_exit_err "$code exists, but is not executable." + __cdist_exit_err "$__cdist_code exists, but is not executable." fi else - __cdist_exit_err "$code exists, but is not a file." + __cdist_exit_err "$__cdist_code exists, but is not a file." fi fi