Changed no-parameter output (shellnotes)

If the user types "shellnotes" without a parameter, shellnotes will check if it is correctly installed to his computer.
(Checks if there is a file made in home)
This commit is contained in:
dmarakom6 2021-01-10 10:37:53 +02:00
parent c65a93d314
commit 5e411ac26e

View file

@ -1,8 +1,4 @@
#!/bin/bash #!usr//bin/env bash
#Change the first line if you don't use bash, in order for the code to work properly.
#Warning! If you don't have gedit(text editor) or nano installed, you may have to change the default text editor (lines 10, 25, 40).
#remember to write this line into your terminal
#chmod +x shellnotes.sh
#Make a Notes folder for the user #Make a Notes folder for the user
cd ~ cd ~
@ -138,7 +134,7 @@ function listnotes() {
#Help for new users #Help for new users
function shellnotes() { function shellnotes() {
if [[ $1 == "-v" ]]; then if [[ $1 == "-v" ]]; then
echo "Shellnotes version: 2.0" echo "Shellnotes version: 2.3"
elif [[ $1 == "-r" ]]; then elif [[ $1 == "-r" ]]; then
echo "Github repository: https://github.com/dmarakom6/shellnotes/blob/master/" echo "Github repository: https://github.com/dmarakom6/shellnotes/blob/master/"
@ -199,17 +195,14 @@ function renamenote() {
read -p "Enter new name: " newnotename read -p "Enter new name: " newnotename
if [ -e $newnotename ]; then if [ -e $newnotename ]; then
echo "There is another note named '$newnotename' in your Notes folder." echo "There is another note named '$newnotename' in your Notes folder."
else fi
mv $notename $newnotename mv $notename $newnotename
clear; clear;
echo "Note renamed from $notename to $newnotename in Home/$me/Notes" echo "Note renamed from $notename to $newnotename in Home/$me/Notes"
echo "-------------------------------------------------------------" echo "-------------------------------------------------------------"
fi
else else
echo "This note does not exist." echo "This note does not exist."
fi fi
cd $dir; cd $dir;
} }