add rm command and cleanup of other commands
This commit is contained in:
parent
96a9cd8325
commit
7dfbb88b07
35
memo
35
memo
|
@ -77,16 +77,34 @@ function git:commit(){
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function git:run_commands(){
|
function git:run_command(){
|
||||||
cd ${MEMO_FOLDER}
|
cd ${MEMO_FOLDER}
|
||||||
${git_cmd} $@
|
${git_cmd} $@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# remove command
|
||||||
|
#
|
||||||
|
|
||||||
|
function remove_topic (){
|
||||||
|
topic_name=$1
|
||||||
|
#precondition::provide_topic ${topic_name}
|
||||||
|
topic_path=${MEMO_FOLDER}/${topic_name}
|
||||||
|
|
||||||
|
if [[ -d ${topic_path} ]]
|
||||||
|
then
|
||||||
|
rm -rf ${topic_path}
|
||||||
|
fi
|
||||||
|
|
||||||
|
git:add_all_topics
|
||||||
|
git:commit "edit : ${topic_name}"
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# edit command
|
# edit command
|
||||||
#
|
#
|
||||||
|
|
||||||
function edit_memo() {
|
function edit_topic () {
|
||||||
topic_name=$1
|
topic_name=$1
|
||||||
precondition::provide_topic ${topic_name}
|
precondition::provide_topic ${topic_name}
|
||||||
topic_path=${MEMO_FOLDER}/${topic_name}
|
topic_path=${MEMO_FOLDER}/${topic_name}
|
||||||
|
@ -275,6 +293,9 @@ Commands:
|
||||||
so piping is possible.
|
so piping is possible.
|
||||||
Example: cat file.txt | memo add topic
|
Example: cat file.txt | memo add topic
|
||||||
|
|
||||||
|
rm <topic>
|
||||||
|
remove ${MEMO_FOLDER}/<topic> (with all its content)
|
||||||
|
|
||||||
copy <topic> <file to copy>
|
copy <topic> <file to copy>
|
||||||
copy a file to ${MEMO_FOLDER}/<topic>/
|
copy a file to ${MEMO_FOLDER}/<topic>/
|
||||||
|
|
||||||
|
@ -292,6 +313,9 @@ Commands:
|
||||||
list
|
list
|
||||||
prints a list of all topics
|
prints a list of all topics
|
||||||
|
|
||||||
|
git <command>
|
||||||
|
run git <command> in ${MEMO_FOLDER}
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -320,13 +344,16 @@ case $command in
|
||||||
show_topic $@
|
show_topic $@
|
||||||
;;
|
;;
|
||||||
edit)
|
edit)
|
||||||
edit_memo $@
|
edit_topic $@
|
||||||
;;
|
;;
|
||||||
list)
|
list)
|
||||||
list_topics
|
list_topics
|
||||||
;;
|
;;
|
||||||
git)
|
git)
|
||||||
git:run_commands $@
|
git:run_command $@
|
||||||
|
;;
|
||||||
|
rm)
|
||||||
|
remove_topic $@
|
||||||
;;
|
;;
|
||||||
*) show_help
|
*) show_help
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in a new issue