Alpha 3
Testing: Print function works
This commit is contained in:
@@ -1,33 +1,28 @@
|
||||
#==========================================================================
|
||||
# Subection: Create
|
||||
#==========================================================================
|
||||
if [ -z "$CREATE" -a -z "$EDIT" -a -z "$PRINT" ]; then #If no action specified, print help and exit
|
||||
help
|
||||
exit
|
||||
else
|
||||
function create(){
|
||||
if [ -z "$CREATE" -a -z "$EDIT" -a -z "$PRINT" ]; then #If no action specified, print help and exit
|
||||
help
|
||||
exit
|
||||
elif [ "$CREATE" == "TRUE" ]; then
|
||||
if [ -e $NOTE -o -e ${NOTE%.*} ]; then
|
||||
echo ""
|
||||
echo "ERROR: Note already exists"
|
||||
echo "Hint: use -e to edit the note."
|
||||
echo ""
|
||||
exit
|
||||
else
|
||||
#Create any necessary folders
|
||||
mkdir -p $NOTEDIR
|
||||
|
||||
#Fill in title
|
||||
echo "TITLE: $NAME" > $NOTE
|
||||
#Fill the second line with the date
|
||||
echo "DATE: $(date)" >> $NOTE
|
||||
|
||||
if [ "$CREATE" == "TRUE" ]; then
|
||||
if [ -e $NOTE -o -e ${NOTE%.*} ]; then
|
||||
|
||||
echo ""
|
||||
echo "ERROR: Note already exists"
|
||||
echo "Hint: use -e to edit the note."
|
||||
echo ""
|
||||
exit
|
||||
else
|
||||
#Create any necessary folders
|
||||
mkdir -p $NOTEDIR
|
||||
|
||||
#Fill in title
|
||||
echo "TITLE: $NAME" > $NOTE
|
||||
#Fill the second line with the date
|
||||
echo "DATE: $(date)" >> $NOTE
|
||||
|
||||
if [ "$ENCRYPTION" == "TRUE" ]; then
|
||||
if [ $EDIT == "FALSE" ]; then
|
||||
openssl enc -aes-256-cbc -salt -in $NOTE -out ${NOTE%.*} -pass pass:$ENC_KEY
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [ "$ENCRYPTION" == "TRUE" ]; then
|
||||
if [ $EDIT == "FALSE" ]; then
|
||||
openssl enc -aes-256-cbc -salt -in $NOTE -out ${NOTE%.*} -pass pass:$ENC_KEY
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user