From 7e645f19cbb655669b05681a501827ff379cd88e Mon Sep 17 00:00:00 2001 From: MorganGeek Date: Thu, 2 Jul 2020 16:51:30 +0200 Subject: [PATCH] replace basic with colored messages formatting --- dot_zsh_functions | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/dot_zsh_functions b/dot_zsh_functions index 0697ece..3323eac 100644 --- a/dot_zsh_functions +++ b/dot_zsh_functions @@ -109,7 +109,7 @@ function istherenewissues() { if [ "$LASTISSUE" != "$previous_jira_issue" ]; then newissues else - echo "no new issue" + success "no new issue" fi fi echo "$LASTISSUE" > "$HOME/.newjiraissue" @@ -209,7 +209,7 @@ function transfer() { # check arguments if [ $# -eq 0 ]; then - echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md" + warning "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md" return 1 fi @@ -225,7 +225,7 @@ function transfer() { if [ ! -e $file ]; then - echo "File $file doesn't exists." + error "File $file doesn't exists." return 1 fi @@ -336,23 +336,30 @@ function gitpushallremote { grv grv | grep push | awk '{print $1}' | while read -r remote do - echo "$remote" + arrow "$remote" git push --all "$remote" done } function clone { local folder=$(basename $1 | sed 's/\.git.*//g') - echo "$folder" - gcls "$1" - cd "$folder" || exit - copyhooks + arrow "git project identified as $folder" + if gcls "$1"; then + if [[ -n "$folder" ]]; then + cd "$folder" || exit + copyhooks + else + error "unable to change current directory to : $folder" + fi + else + error "unable to clone repository url : $1" + fi } function colorpic { local picture_url="$1" - echo "Colorizing $picture_url" + arrow "Colorizing $picture_url" local result_url=$(\curl -F "image=@$picture_url" -H "api-key:$COLORPIC_APIKEY" https://api.deepai.org/api/colorizer -s | jq '.output_url' | strings) - echo "Generated $result_url" - echo "Display in progress..." + success "Generated $result_url" + arrow "Display in progress..." eval "\curl -s $result_url | imgcat" } function brewadd {