From 256c9c5bca5a38eba2ee4bcbdb111213728c9e41 Mon Sep 17 00:00:00 2001 From: AYA Date: Wed, 31 Jul 2024 17:04:45 +0200 Subject: [PATCH] restyle the restyler --- scripts/helpers/restyle-diff.sh | 54 ++++++++++++++++----------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/scripts/helpers/restyle-diff.sh b/scripts/helpers/restyle-diff.sh index 751836bccdd027..5f37c69762e281 100755 --- a/scripts/helpers/restyle-diff.sh +++ b/scripts/helpers/restyle-diff.sh @@ -40,20 +40,20 @@ cd "$CHIP_ROOT" restyle-paths() { image=restyled/restyler:edge - ( - docker run \ - --env LOG_LEVEL \ - --env LOG_DESTINATION \ - --env LOG_FORMAT \ - --env LOG_COLOR \ - --env HOST_DIRECTORY="$PWD" \ - --env UNRESTRICTED=1 \ - --volume "$PWD":/code \ - --volume /tmp:/tmp \ - --volume /var/run/docker.sock:/var/run/docker.sock \ - --entrypoint restyle-path \ - "$image" "$@" - ) + + docker run \ + --env LOG_LEVEL \ + --env LOG_DESTINATION \ + --env LOG_FORMAT \ + --env LOG_COLOR \ + --env HOST_DIRECTORY="$PWD" \ + --env UNRESTRICTED=1 \ + --volume "$PWD":/code \ + --volume /tmp:/tmp \ + --volume /var/run/docker.sock:/var/run/docker.sock \ + --entrypoint restyle-path \ + "$image" "$@" + } #This was added to be able to use xargs to call the function restyle-paths @@ -61,18 +61,18 @@ export -f restyle-paths while [[ $# -gt 0 ]]; do case "$1" in - -d) - export LOG_LEVEL="DEBUG" - shift - ;; - -p) - pull_image=1 - shift - ;; - *) - ref="$1" - shift - ;; + -d) + export LOG_LEVEL="DEBUG" + shift + ;; + -p) + pull_image=1 + shift + ;; + *) + ref="$1" + shift + ;; esac done @@ -87,4 +87,4 @@ fi paths=$(git diff --ignore-submodules --name-only --merge-base "$ref") -echo "$paths" | xargs -n $MAX_ARGS bash -c 'restyle-paths "$@"' +echo "$paths" | xargs -n "$MAX_ARGS" bash -c 'restyle-paths "$@"'