diff --git a/docs/commands.txt b/docs/commands.txt index a109241..e52c407 100644 --- a/docs/commands.txt +++ b/docs/commands.txt @@ -11,4 +11,5 @@ findmisplacednote renamenote shellnotes (-u/-v/-r/-l/-sd/-h/-au) clearlogs +resetshellnotes (-f) noteinfo \ No newline at end of file diff --git a/docs/system/reset.txt b/docs/system/reset.txt index 800c1b7..dec76d7 100644 --- a/docs/system/reset.txt +++ b/docs/system/reset.txt @@ -14,6 +14,8 @@ This command is made mostly for shellnotes' developers. After testing a new rele They must clear their data from the program's source files, in order to push them to the repository. +You can use the "-f/--force" parameter to avoid prompt when running resetshellnotes. + This command should be used ONLY WHEN NECESSARY, just like all other hidden commands. If your notes have disappeared, or you cant find the displayed note folder, use this command to reset everything to its normal state. diff --git a/util/.hidden/.resetshellnotes.sh b/util/.hidden/.resetshellnotes.sh index 7d0c94c..c6f7f72 100644 --- a/util/.hidden/.resetshellnotes.sh +++ b/util/.hidden/.resetshellnotes.sh @@ -6,17 +6,30 @@ in /docs/github/ for its full text. info function resetshellnotes() { - echo "Be aware that this command will erase shellnotes' memory." - echo "This contains default editors and folder, logfiles and user data and cache." - echo "Your Notes will not be removed." - echo -n "Proceed? " && read input - case $input in y|Yes|Y|YES|yes) + + proceed() { echo "y\n" | clearlogs >/dev/null echo "" > ~/.shellnotes/util/listnotes/output/* echo "/usr/bin/gedit" > ~/.shellnotes/util/sd/sd-input1.txt echo "/bin/nano"> ~/.shellnotes/util/sd/sd-input2.txt echo "~/Notes" > ~/.shellnotes/util/sd/sd-input3.txt + } + + case $1 in -f | --force ) + proceed + cd $DIR + return 0 esac + + echo "Be aware that this command will erase shellnotes' memory." + echo "This contains default editors and folder, logfiles and user data and cache." + echo "Your Notes will not be removed." + echo -n "Proceed? " && read input + case $input in y|Yes|Y|YES|yes) + proceed + echo "Done." + esac + cd $DIR return 0 } \ No newline at end of file