replace basic with colored messages formatting

This commit is contained in:
MorganGeek 2020-07-02 16:51:30 +02:00
parent 2eaee51534
commit 7e645f19cb

View File

@ -109,7 +109,7 @@ function istherenewissues() {
if [ "$LASTISSUE" != "$previous_jira_issue" ]; then if [ "$LASTISSUE" != "$previous_jira_issue" ]; then
newissues newissues
else else
echo "no new issue" success "no new issue"
fi fi
fi fi
echo "$LASTISSUE" > "$HOME/.newjiraissue" echo "$LASTISSUE" > "$HOME/.newjiraissue"
@ -209,7 +209,7 @@ function transfer() {
# check arguments # check arguments
if [ $# -eq 0 ]; if [ $# -eq 0 ];
then 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 return 1
fi fi
@ -225,7 +225,7 @@ function transfer() {
if [ ! -e $file ]; if [ ! -e $file ];
then then
echo "File $file doesn't exists." error "File $file doesn't exists."
return 1 return 1
fi fi
@ -336,23 +336,30 @@ function gitpushallremote {
grv grv
grv | grep push | awk '{print $1}' | while read -r remote grv | grep push | awk '{print $1}' | while read -r remote
do do
echo "$remote" arrow "$remote"
git push --all "$remote" git push --all "$remote"
done done
} }
function clone { function clone {
local folder=$(basename $1 | sed 's/\.git.*//g') local folder=$(basename $1 | sed 's/\.git.*//g')
echo "$folder" arrow "git project identified as $folder"
gcls "$1" if gcls "$1"; then
if [[ -n "$folder" ]]; then
cd "$folder" || exit cd "$folder" || exit
copyhooks copyhooks
else
error "unable to change current directory to : $folder"
fi
else
error "unable to clone repository url : $1"
fi
} }
function colorpic { function colorpic {
local picture_url="$1" 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) 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" success "Generated $result_url"
echo "Display in progress..." arrow "Display in progress..."
eval "\curl -s $result_url | imgcat" eval "\curl -s $result_url | imgcat"
} }
function brewadd { function brewadd {