Skip to content

Commit

Permalink
Merge pull request #20 from internetwache/fix_color_codes
Browse files Browse the repository at this point in the history
Use \033 instead of \e for color codes
  • Loading branch information
gehaxelt authored Oct 16, 2018
2 parents fe4e3d0 + 2c0be6c commit 217d77c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Dumper/gitdumper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,20 @@ GITDIR=$(get_git_dir "$@")
BASEGITDIR="$BASEDIR/$GITDIR/";

if [ $# -lt 2 ]; then
echo -e "\e[33m[*] USAGE: http://target.tld/.git/ dest-dir [--git-dir=otherdir]\e[0m";
echo -e "\033[33m[*] USAGE: http://target.tld/.git/ dest-dir [--git-dir=otherdir]\033[0m";
echo -e "\t\t--git-dir=otherdir\t\tChange the git folder name. Default: .git"
exit 1;
fi


if [[ ! "$BASEURL" =~ /$GITDIR/$ ]]; then
echo -e "\e[31m[-] /$GITDIR/ missing in url\e[0m";
echo -e "\033[31m[-] /$GITDIR/ missing in url\033[0m";
exit 0;
fi

if [ ! -d "$BASEGITDIR" ]; then
echo -e "\e[33m[*] Destination folder does not exist\e[0m";
echo -e "\e[32m[+] Creating $BASEGITDIR\e[0m";
echo -e "\033[33m[*] Destination folder does not exist\033[0m";
echo -e "\033[32m[+] Creating $BASEGITDIR\033[0m";
mkdir -p "$BASEGITDIR";
fi

Expand Down Expand Up @@ -115,10 +115,10 @@ function download_item() {
#Mark as downloaded and remove it from the queue
DOWNLOADED+=("$objname")
if [ ! -f "$target" ]; then
echo -e "\e[31m[-] Downloaded: $objname\e[0m"
echo -e "\033[31m[-] Downloaded: $objname\033[0m"
return
fi
echo -e "\e[32m[+] Downloaded: $objname\e[0m"
echo -e "\033[32m[+] Downloaded: $objname\033[0m"

#Check if we have an object hash
if [[ "$objname" =~ /[a-f0-9]{2}/[a-f0-9]{38} ]]; then
Expand Down

0 comments on commit 217d77c

Please sign in to comment.