From dcb4395909124e5680686cb314df6bda6b30fdcf Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Mon, 8 Oct 2018 17:13:13 +0200 Subject: [PATCH] Resolve custom remote copy/exec shellcheck (non-)issues. --- cdist/conf/type/__install_config/files/remote/copy | 4 +++- cdist/conf/type/__install_config/files/remote/exec | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cdist/conf/type/__install_config/files/remote/copy b/cdist/conf/type/__install_config/files/remote/copy index 78af31b9..0f68b1ea 100755 --- a/cdist/conf/type/__install_config/files/remote/copy +++ b/cdist/conf/type/__install_config/files/remote/copy @@ -41,6 +41,8 @@ log "@: $*" log "code: $code" # copy files into chroot -"$__default_remote_copy" "$code" +# code should be split on spaces +# shellcheck disable=SC2086 +"$__default_remote_copy" $code log "-----" diff --git a/cdist/conf/type/__install_config/files/remote/exec b/cdist/conf/type/__install_config/files/remote/exec index ea7396e0..3a48c58f 100755 --- a/cdist/conf/type/__install_config/files/remote/exec +++ b/cdist/conf/type/__install_config/files/remote/exec @@ -36,6 +36,7 @@ shift # escape ' with '"'"' code="$(echo "$@" | sed -e "s/'/'\"'\"'/g")" +# shellcheck disable=SC2089 code="chroot $chroot sh -e -c '$code'" log "target_host: $target_host" @@ -44,6 +45,8 @@ log "@: $*" log "code: $code" # Run the code -"$__default_remote_exec" "$target_host" "$code" +# code should be split on spaces +# shellcheck disable=SC2086,SC2090 +"$__default_remote_exec" "$target_host" $code log "-----"