argc-=1 for cdist-object-gencode

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-03-18 00:28:05 +01:00
parent 2f207c29e5
commit 0f83417652
2 changed files with 3 additions and 7 deletions

View file

@ -23,11 +23,10 @@
#
. cdist-config
[ $# -eq 3 ] || __cdist_usage "<target host>" "<object_base_dir>" "<object>"
[ $# -eq 2 ] || __cdist_usage "<target host>" "<object>"
set -eu
__cdist_target_host="$1"; shift
__cdist_object_base_dir="$1"; shift
__cdist_object="$1"; shift
__cdist_object_dir="$(__cdist_object_dir "$__cdist_object")"
@ -55,7 +54,7 @@ if [ -x "$gencode" ]; then
__cdist_exec_fail_on_error "$gencode"
else
if [ -f "$gencode" ]; then
echo "$gencode" exists, but is not executable >&2
echo "Warning: $gencode exists, but is not executable" >&2
fi
# No gencode? also fine! Ensure we exit 0

View file

@ -23,7 +23,6 @@
. cdist-config
[ $# -eq 1 ] || __cdist_usage "<target host>"
set -eu
__cdist_target_host="$1"; shift
@ -34,9 +33,7 @@ while read object; do
code="$(__cdist_object_code "$object")"
echo "Generating code for $object ..."
cdist-object-gencode "$__cdist_target_host" \
"$__cdist_out_object_dir" \
"$object" > "${code}"
cdist-object-gencode "$__cdist_target_host" "$object" > "${code}"
chmod u+x "${code}"
done < "$__cdist_tmp_file"