mirror of https://github.com/sobolevn/git-secret
fix
parent
900717707b
commit
50b23c9739
@ -0,0 +1,44 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
|
||||||
|
function cat {
|
||||||
|
local homedir=''
|
||||||
|
local passphrase=''
|
||||||
|
|
||||||
|
OPTIND=1
|
||||||
|
|
||||||
|
while getopts 'hd:p:' opt; do
|
||||||
|
case "$opt" in
|
||||||
|
h) _show_manual_for 'cat';;
|
||||||
|
|
||||||
|
p) passphrase=$OPTARG;;
|
||||||
|
|
||||||
|
d) homedir=$OPTARG;;
|
||||||
|
|
||||||
|
*) _invalid_option_for 'cat';;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
shift $((OPTIND-1))
|
||||||
|
[ "$1" = '--' ] && shift
|
||||||
|
|
||||||
|
_user_required
|
||||||
|
|
||||||
|
# Command logic:
|
||||||
|
|
||||||
|
for line in "$@"
|
||||||
|
do
|
||||||
|
local filename
|
||||||
|
local path
|
||||||
|
|
||||||
|
filename=$(_get_record_filename "$line")
|
||||||
|
path=$(_append_root_path "$filename")
|
||||||
|
|
||||||
|
# The parameters are: filename, write-to-file, force, homedir, passphrase
|
||||||
|
_decrypt "$path" "0" "0" "$homedir" "$passphrase"
|
||||||
|
|
||||||
|
#if [[ "$?" ne "0" ]]; then
|
||||||
|
# _abort( "error decrypting $(filename): $?" )
|
||||||
|
#fi
|
||||||
|
done
|
||||||
|
}
|
Loading…
Reference in New Issue