Add "-f" parameter to resetshellnotes

This commit is contained in:
dmarakom6 2021-04-24 19:10:08 +03:00
parent c9f9a5cb21
commit 79e9e6ed0d
3 changed files with 21 additions and 5 deletions

View file

@ -11,4 +11,5 @@ findmisplacednote
renamenote
shellnotes (-u/-v/-r/-l/-sd/-h/-au)
clearlogs
resetshellnotes (-f)
noteinfo

View file

@ -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.

View file

@ -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
}