Skip to content

Commit b8e2684

Browse files
authored
Merge pull request #56 from cisagov/improvement/run_packer_fmt_on_directories
Run `packer fmt` on directories instead of files
2 parents 15a2656 + f58f1d8 commit b8e2684

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

hooks/packer_fmt.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ source "$SCRIPT_DIR/../lib/util.sh"
1717

1818
util::parse_cmdline "$@"
1919

20+
util::get_unique_directory_paths "${FILES[@]}"
21+
2022
pids=()
21-
for file in "${FILES[@]}"; do
23+
for path in "${UNIQUE_PATHS[@]}"; do
2224
# Check each path in parallel
2325
{
24-
packer fmt "${ARGS[@]}" -- "$file"
26+
packer fmt "${ARGS[@]}" -- "$path"
2527
} &
2628
pids+=("$!")
2729
done

0 commit comments

Comments
 (0)