git-secret
git-secret copied to clipboard
test with spaces in the parent directory
WIP for #135 Currently just shows problem
- analysis shows error is happening in
gitignore_add_pattern
's call to_gawk_inplace
when runninggit-secret-init
- This is output from
bash -x
ongit-secret-init
in directory with spaces, showing problem:
(... LOTS REMOVED ...)
++ gawk -v 'RS='\''' -v 'FS='\''' 'END{ gsub(/^\s+/,""); print $1 }'
'\'' /home/examp/tmp/gitsec test/.gitignore'
+ dest_file='/home/examp/tmp/gitsec test/.gitignore'
+ _temporary_file
++ _os_based __temp_file
++ case "$(uname -s)" in
+++ uname -s
++ __temp_file_linux
++ local filename
+++ mktemp -p /tmp _git_secret.XXXXXX
++ filename=/tmp/_git_secret.RLgKjh
++ echo /tmp/_git_secret.RLgKjh
+ temporary_filename=/tmp/_git_secret.RLgKjh
+ trap 'if [[ -f "$temporary_filename" ]]; then if [[ -n "$_SECRETS_VERBOSE" ]] || [[ -n "$SECRETS_TEST_VERBOSE" ]]; then echo "git-secret: cleaning up: $temporary_filename"; fi; rm -f "$temporary_filename"; fi;' EXIT
+ bash -c 'gawk -v pattern=.gitsecret/keys/random_seed '\''
BEGIN {
cnt=0
}
function check_print_line(line){
if (line == pattern) {
cnt++
}
print line
}
# main function
{
check_print_line($0) # check and print first line
while (getline == 1) { # check and print all other
check_print_line($0)
}
}
END {
if ( cnt == 0) { # if file did not contain pattern add
print pattern
}
}
'\'' /home/examp/tmp/gitsec test/.gitignore'
gawk: cmd. line:3: fatal: cannot open file `/home/examp/tmp/gitsec' for reading (No such file or directory)
+ [[ -f /tmp/_git_secret.RLgKjh ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ rm -f /tmp/_git_secret.RLgKjh
@sobolevn this is as we discussed last
Edit: we cannot easily depend on perl in place of awk in all cases; in particular; alpine's git packages (unlike most) do not install perl
closing for now