Skip to content

Commit

Permalink
error when run as root
Browse files Browse the repository at this point in the history
  • Loading branch information
SkwalExe committed Mar 23, 2022
1 parent 484fea2 commit 120388e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dtodo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ bg_purple='\033[0;45m'
reset='\033[0m'


if [ "$EUID" -eq "0" ]; then
echo -e "${red}Error: Don't run this script as root${reset}"
exit 1
fi



function printTodoList() { # Prints the specified (first argument passed to the function) todo list
Expand All @@ -40,6 +45,8 @@ function checkExist() { # Check if the current todo file ($tdfile) exists
fi
}

checkExist

tdfile="dtodo" # the todo file to execute the action on
# the todo files are ~/.dtodo-*
# the default todo file is ~/.dtodo
Expand Down

0 comments on commit 120388e

Please sign in to comment.