refactor(notes): clean up; wrap login in main function
This commit is contained in:
parent
3f2f90b1c9
commit
5969c69bab
1 changed files with 128 additions and 129 deletions
11
notes.sh
11
notes.sh
|
@ -1,15 +1,9 @@
|
||||||
#! /usr/bin/bash
|
#! /usr/bin/bash
|
||||||
|
|
||||||
## notes management
|
|
||||||
|
|
||||||
# Load config
|
# Load config
|
||||||
. ${HOME}/ayo.conf
|
. ${HOME}/ayo.conf
|
||||||
. ${scripts_dir}/functions.sh
|
. ${scripts_dir}/functions.sh
|
||||||
|
|
||||||
# TODO: write log for echoes with >>>
|
|
||||||
|
|
||||||
command=$1
|
|
||||||
|
|
||||||
getopts "t" typora; #check if -t flag is given
|
getopts "t" typora; #check if -t flag is given
|
||||||
|
|
||||||
function editFile() {
|
function editFile() {
|
||||||
|
@ -55,6 +49,7 @@ function createNote() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
|
||||||
## DIFF
|
## DIFF
|
||||||
if [ "$1" = "diff" ] || [ "$1" = "d" ]; then
|
if [ "$1" = "diff" ] || [ "$1" = "d" ]; then
|
||||||
|
@ -191,3 +186,7 @@ elif [ "$1" = "copy" ] || [ "$1" = "c" ]; then
|
||||||
else
|
else
|
||||||
createNote
|
createNote
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
main
|
Loading…
Reference in a new issue