diff --git a/memo b/memo index f17765b..c344591 100755 --- a/memo +++ b/memo @@ -77,16 +77,34 @@ function git:commit(){ fi } -function git:run_commands(){ +function git:run_command(){ cd ${MEMO_FOLDER} ${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 # -function edit_memo() { +function edit_topic () { topic_name=$1 precondition::provide_topic ${topic_name} topic_path=${MEMO_FOLDER}/${topic_name} @@ -275,6 +293,9 @@ Commands: so piping is possible. Example: cat file.txt | memo add topic + rm + remove ${MEMO_FOLDER}/ (with all its content) + copy copy a file to ${MEMO_FOLDER}// @@ -292,6 +313,9 @@ Commands: list prints a list of all topics + git + run git in ${MEMO_FOLDER} + EOF } @@ -320,13 +344,16 @@ case $command in show_topic $@ ;; edit) - edit_memo $@ + edit_topic $@ ;; list) list_topics ;; git) - git:run_commands $@ + git:run_command $@ + ;; + rm) + remove_topic $@ ;; *) show_help ;;