2.0a4 -> 2.0a5
Changed some filenames Rewrote edit function to be more sane Separated encryption and decryption functions from edit into libencryption.sh Fixed a bug where an edit tag would be added regardless of create status
This commit is contained in:
21
src/includes/edit.sns.sh
Normal file
21
src/includes/edit.sns.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
function edit(){
|
||||
if [ ! -r "$NOTE" ]; then
|
||||
echo "ERROR: Note cannot be opened for editing."
|
||||
exit 40;
|
||||
fi
|
||||
|
||||
if [ "$ENCRYPTION" == "TRUE" ]; then decrypt
|
||||
else TARGET="$NOTE"; fi
|
||||
|
||||
|
||||
if [ -z "$CREATE" ]; then printf "\nEDIT $(date)" >> "$TARGET"; fi
|
||||
|
||||
|
||||
|
||||
"$EDITOR" "$TARGET"
|
||||
|
||||
if [ "$ENCRYPTION" == "TRUE" ]; then encrypt; fi
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user