Updated vns_import to use vns_gpgid, as well as create nonexistent paths
This commit is contained in:
13
vns
13
vns
@@ -301,10 +301,17 @@ vns_import () {
|
||||
esac
|
||||
fi
|
||||
|
||||
printf "%s:" "Specify GPG Public Key: "
|
||||
local gpg_key=''; read -r gpg_key
|
||||
#printf "%s:" "Specify GPG Public Key: "
|
||||
#local gpg_key=''; read -r gpg_key
|
||||
|
||||
# Create any necessary directories
|
||||
mkdir -p "$VNS_STORE/$(dirname "$2.gpg")"
|
||||
|
||||
gpg2 --batch -r "$gpg_key" -o "$VNS_STORE/$2.gpg" -e "$1"
|
||||
if [ "${1##*.}" == "gpg" ]; then
|
||||
gpg --batch --decrypt "$1" | gpg2 --batch "$(vns_gpgid)" -o "$VNS_STORE/$2.gpg" --encrypt
|
||||
else
|
||||
gpg2 --batch "$(vns_gpgid)" -o "$VNS_STORE/$2.gpg" --encrypt "$1"
|
||||
fi
|
||||
|
||||
vns_git add "$VNS_STORE/$2.gpg"
|
||||
vns_git commit -m "Imported file $1 as $2"
|
||||
|
||||
Reference in New Issue
Block a user