Skip to content

Commit

Permalink
restyle the restyler
Browse files Browse the repository at this point in the history
  • Loading branch information
Alami-Amine committed Jul 31, 2024
1 parent e6afd0e commit 256c9c5
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions scripts/helpers/restyle-diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,39 +40,39 @@ 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
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

Expand All @@ -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 "$@"'

0 comments on commit 256c9c5

Please sign in to comment.