Skip to content

Commit b6017f1

Browse files
committed
Test flock on directory rather than stdin
1 parent 30b3069 commit b6017f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hooks/_common.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ function common::terraform_init {
348348
# https://github.com/hashicorp/terraform/issues/31964
349349
if [ -n "$TF_PLUGIN_CACHE_DIR" ]; then
350350
echo "$(date "+%s %N") DBG $dir_path: 1. flock --exclusive"
351-
flock --exclusive 0 #! NOT EXIST IN MAC - https://stackoverflow.com/questions/10526651/mac-os-x-equivalent-of-linux-flock1-command
351+
flock --exclusive "$TF_PLUGIN_CACHE_DIR" terraform init #! NOT EXIST IN MAC - https://stackoverflow.com/questions/10526651/mac-os-x-equivalent-of-linux-flock1-command
352352
fi
353353

354354
echo "$(date "+%s %N") DBG $dir_path: 2. before tf init"
@@ -366,7 +366,7 @@ function common::terraform_init {
366366
fi
367367

368368
if [ -n "$TF_PLUGIN_CACHE_DIR" ]; then
369-
flock --unlock 0 #! NOT EXIST IN MAC - https://stackoverflow.com/questions/10526651/mac-os-x-equivalent-of-linux-flock1-command
369+
flock --unlock "$TF_PLUGIN_CACHE_DIR" terraform init #! NOT EXIST IN MAC - https://stackoverflow.com/questions/10526651/mac-os-x-equivalent-of-linux-flock1-command
370370
echo "$(date "+%s %N") DBG $dir_path: 3. after tf init. flock --unlock"
371371
fi
372372

0 commit comments

Comments
 (0)