From fda5a0ad21be2e6a096f01c9a8af57ea91c9a8f1 Mon Sep 17 00:00:00 2001 From: joshr Date: Sun, 22 Jul 2018 21:29:01 -0400 Subject: [PATCH] fixes and debug for 'reveal -c' option --- src/commands/git_secret_reveal.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/commands/git_secret_reveal.sh b/src/commands/git_secret_reveal.sh index a1826441..f2ad57be 100644 --- a/src/commands/git_secret_reveal.sh +++ b/src/commands/git_secret_reveal.sh @@ -49,10 +49,15 @@ function reveal { _abort "cannot find decrypted version of file: $filename" fi - if [[ "$chmod" ]]; then + if [[ "$chmod" == 1 ]]; then local perms - perms=$(stat -f "%Op" "$filename") - chmod "$perms" "$path" + perms=$($SECRETS_OCTAL_PERMS_COMMAND "$filename") + + echo "# octal_perms_command: $SECRETS_OCTAL_PERMS_COMMAND" >&3 + echo "# filename is '$filename', path is '$path'" >&3 + echo "# NOT running: chmod $perms $path" >&3 + + #chmod "$perms" "$path" fi counter=$((counter+1))