Skip to content

Commit 5809880

Browse files
committed
fixed missing rm from notes edit command
1 parent 4cd9706 commit 5809880

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

notes

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,39 @@ note-import() {
115115
fi
116116
}
117117

118+
note-view() {
119+
notefile="$USE_POINTER/$@"
118120

121+
get_recipient
122+
123+
if [ -f "${notefile}" ]; then
124+
gpg -d "${notefile}" | ${PAGER:-more}
125+
elif [ -f "${notefile}.gpg" ]; then
126+
gpg -d "${notefile}.gpg" | ${PAGER:-more}
127+
else
128+
echo Note file does not exist
129+
fi
130+
}
119131

120-
note-view() {
132+
note-edit() {
121133
notefile="$USE_POINTER/$@"
134+
decrypted="`echo ${notefile} | sed s/.gpg//`"
135+
136+
get_recipient
137+
138+
echo $notefile
139+
echo $decrypted
122140

123141
if [ -f "$notefile" ]; then
124-
gpg -d "$notefile" | ${PAGER:-more}
142+
gpg -d -o "${decrypted}" "${notefile}"
143+
${EDITOR} "${decrypted}"
144+
$GPG -e -r $KEY $GPG_OPTS "${decrypted}"
145+
rm ${decrypted}
125146
elif [ -f "${notefile}.gpg" ]; then
126-
gpg -d "${notefile}.gpg" | ${PAGER:-more}
147+
gpg -d -o "${decrypted}" "${notefile}.gpg"
148+
${EDITOR} "${decrypted}"
149+
$GPG -e -r $KEY $GPG_OPTS "${decrypted}"
150+
rm ${decrypted}
127151
else
128152
echo Note file does not exist
129153
fi

0 commit comments

Comments
 (0)