forked from ungleich-public/cdist
Merge branch 'master' into types_explorer
This commit is contained in:
commit
53b51b0ead
2 changed files with 7 additions and 9 deletions
|
@ -25,13 +25,11 @@
|
|||
#
|
||||
|
||||
. cdist-config
|
||||
|
||||
[ $# -ge 1 ] || __cdist_usage "<id> <options>"
|
||||
|
||||
set -eu
|
||||
|
||||
export __cdist_object_id="$1"; shift
|
||||
export __cdist_type="$__cdist_myname"
|
||||
__cdist_object_id="$1"; shift
|
||||
__cdist_type="$__cdist_myname"
|
||||
|
||||
echo "$__cdist_object_id" | grep -q "^${__cdist_sane_regexp}\$" || \
|
||||
__cdist_usage "Insane object id, ${__cdist_object_id}."
|
||||
|
@ -53,7 +51,7 @@ mkdir -p "${__cdist_ddir}"
|
|||
echo "${__cdist_manifest}" > "${__cdist_ddir}/${__cdist_name_object_source}"
|
||||
|
||||
# Record parameters to subdir
|
||||
tempparams="${__cdist_tmp_dir}/params"
|
||||
tempparams="${__cdist_tmp_dir}/${__cdist_name_type_params}"
|
||||
mkdir -p "$tempparams"
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
|
@ -82,7 +80,7 @@ done < "$(__cdist_type_param_file "$__cdist_type" "$__cdist_name_type_params_req
|
|||
|
||||
# Allow optional parameters
|
||||
while read optional; do
|
||||
if [ -f "${tempparams}/${opt_file}" ]; then
|
||||
if [ -f "${tempparams}/${optional}" ]; then
|
||||
mv "${tempparams}/${optional}" "${__cdist_ddir}"
|
||||
fi
|
||||
done < "$(__cdist_type_param_file "$__cdist_type" "$__cdist_name_type_params_optional")"
|
||||
|
|
|
@ -33,11 +33,11 @@ fi
|
|||
|
||||
case "$type" in
|
||||
directory)
|
||||
echo mkdir \"$path\"
|
||||
echo mkdir \"$destination\"
|
||||
;;
|
||||
|
||||
file)
|
||||
echo touch \"$path\"
|
||||
echo touch \"$destination\"
|
||||
;;
|
||||
|
||||
*)
|
||||
|
@ -48,5 +48,5 @@ esac
|
|||
|
||||
if [ -f mode ]; then
|
||||
mode="$(cat mode)"
|
||||
echo chmod \"$mode\" \"$path\"
|
||||
echo chmod \"$mode\" \"$destination\"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue