Loading git-crypt-unlock-all.sh +21 −11 Original line number Diff line number Diff line Loading @@ -33,6 +33,22 @@ function verify_gpg_passphrase() { done } function do_unlock() { echo unlock $PWD keyfile=$1 if [ ! -z $keyfile ]; then git-crypt unlock $keyfile else expect <<EOF spawn git-crypt unlock expect "Enter passphrase:" send "$passphrase\r"; expect eof EOF fi } # MAIN keyfile=${1:-''} if [ -z $keyfile ]; Loading @@ -43,6 +59,10 @@ else [ ! -f $keyfile ] && abort "unable to read $keyfile." fi # unlock current repo do_unlock $keyfile # unlock submodules modules=$(git submodule status) [ -z "$modules" ] && abort "No submodules" Loading @@ -57,17 +77,7 @@ do ( echo "Checking out $i master branch" cd $m git checkout master if [ ! -z $keyfile ]; then git-crypt unlock $keyfile else expect <<EOF spawn git-crypt unlock expect "Enter passphrase:" send "$passphrase\r"; expect eof EOF fi do_unlock $keyfile ) fi done Loading
git-crypt-unlock-all.sh +21 −11 Original line number Diff line number Diff line Loading @@ -33,6 +33,22 @@ function verify_gpg_passphrase() { done } function do_unlock() { echo unlock $PWD keyfile=$1 if [ ! -z $keyfile ]; then git-crypt unlock $keyfile else expect <<EOF spawn git-crypt unlock expect "Enter passphrase:" send "$passphrase\r"; expect eof EOF fi } # MAIN keyfile=${1:-''} if [ -z $keyfile ]; Loading @@ -43,6 +59,10 @@ else [ ! -f $keyfile ] && abort "unable to read $keyfile." fi # unlock current repo do_unlock $keyfile # unlock submodules modules=$(git submodule status) [ -z "$modules" ] && abort "No submodules" Loading @@ -57,17 +77,7 @@ do ( echo "Checking out $i master branch" cd $m git checkout master if [ ! -z $keyfile ]; then git-crypt unlock $keyfile else expect <<EOF spawn git-crypt unlock expect "Enter passphrase:" send "$passphrase\r"; expect eof EOF fi do_unlock $keyfile ) fi done