Skip to content

Commit

Permalink
Added erlog.sh to log errors to stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
wesscoby committed Jun 10, 2019
1 parent 6ee54d8 commit 1455a26
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bin/st
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if [[ $(fileExists ".git") == "true" ]];
then
status;
else
printf "${bldred}%s${none}\n" "This Directory is not a Git repository";
../erlog.sh "This Directory is not a Git repository";
exit 0;
fi

Expand Down
23 changes: 23 additions & 0 deletions helpers/erlog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

#: Title: erlog.sh
#: Date: Mon Jun 10 10:48:01 DST 2019
#: Author: [Your name]
#: Version: 1.0.0
#: Description: A script to log errors to stdout

### Text style and color formatting
bold="\033[1m"
white="\033[37m"
black="\033[30m"
red="\033[31m"
bgRed="\033[41m"
bgGreen="\033[42m"
reset_formatting="\033[0m"


if [[ -n $1 ]]; then
printf "${bold}${white}${bgRed} ERROR: ${reset_formatting}${bold}${red} %s! ${reset_formatting}\n" "$1";
else
exit 0;
fi

0 comments on commit 1455a26

Please sign in to comment.