diff --git a/CHANGELOG.md b/CHANGELOG.md index ffc0dda..8822ddc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +#### 2.2.0 +* feat(init): add option to sign initial commit (#59) +* feat(git-flow): add support for environment credentials (#19) +* feat(git-flow): add support for busybox(#12) +* feat(feature): add feature release command (#64) +* feat(hotfix): add cherrypick option to hotfix finish (#73) +* feat(hotfix): add backmerge option to release branch (#71) +* fix(hotfix): git flow hotfix finish -b still back-merges to develop (#66) +* fix(hotfix): git flow hotfix track fails due to branch name check (#68) +* fix: git flow log help message (#15) + #### 2.1.0 * feat: add create command to release allowing for a single step release prodution * feat: add missing hook script filter-flow-release-finish-version @@ -7,7 +18,6 @@ * docs: update readme with better description as to why this fork was created. Thank You [shaedrick](https://github.com/shaedrich) **NOTE:** The format for a multi-line tag message is now "$(printf 'line of text with \n escape codes placed as needed for proper formating of the message')" - #### 2.0.1 * fix incorrect version identification along with updating source repository in gitflow-installer. Corrections pointed out by [bobstuart](https://github.com/bobstuart) diff --git a/git-flow b/git-flow index f21a3dc..dfe85e4 100755 --- a/git-flow +++ b/git-flow @@ -7,9 +7,10 @@ # http://blog.avirtualhome.com/development-workflow-using-git/ # # Feel free to contribute to this project at: -# http://github.com/petervanderdoes/gitflow +# http://github.com/CJ-Systems/gitflow-cjs # # Authors: +# Copyright 2003 CJ Systems. All rights reserved. # Copyright 2012-2019 Peter van der Does. All rights reserved. # # Original Author: @@ -46,7 +47,7 @@ fi # git-flow file is a symbolic link case $(uname -s) in Linux) - export GITFLOW_DIR=$(dirname "$(readlink -e "$0")") + export GITFLOW_DIR=$(dirname "$(readlink -f "$0")") ;; FreeBSD|OpenBSD|NetBSD) export FLAGS_GETOPT_CMD='/usr/local/bin/getopt' diff --git a/git-flow-bugfix b/git-flow-bugfix index 131921b..297324c 100644 --- a/git-flow-bugfix +++ b/git-flow-bugfix @@ -8,9 +8,10 @@ # http://blog.avirtualhome.com/development-workflow-using-git/ # # Feel free to contribute to this project at: -# http://github.com/petervanderdoes/gitflow +# http://github.com/CJ-Systems/gitflow-cjs # # Authors: +# Copyright 2003 CJ Systems. All rights reserved. # Copyright 2012-2019 Peter van der Does. All rights reserved. # # Original Author: diff --git a/git-flow-config b/git-flow-config index 44b4c67..70843c9 100644 --- a/git-flow-config +++ b/git-flow-config @@ -8,9 +8,10 @@ # http://blog.avirtualhome.com/development-workflow-using-git/ # # Feel free to contribute to this project at: -# http://github.com/petervanderdoes/gitflow +# http://github.com/CJ-Systems/gitflow-cjs # # Authors: +# Copyright 2003 CJ Systems. All rights reserved. # Copyright 2012-2019 Peter van der Does. All rights reserved. # # diff --git a/git-flow-feature b/git-flow-feature index ca94e9d..c5c5eea 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -8,9 +8,10 @@ # http://blog.avirtualhome.com/development-workflow-using-git/ # # Feel free to contribute to this project at: -# http://github.com/petervanderdoes/gitflow +# http://github.com/CJ-Systems/gitflow-cjs # # Authors: +# Copyright 2003 CJ Systems. All rights reserved. # Copyright 2012-2019 Peter van der Does. All rights reserved. # # Original Author: @@ -58,6 +59,7 @@ git flow feature checkout git flow feature pull git flow feature delete git flow feature rename +git flow feature release Manage your feature branches. @@ -429,6 +431,36 @@ no-ff! Never fast-forward during the merge helper_finish_cleanup } +cmd_release() { + OPTIONS_SPEC="\ +git flow feature release [-h] + +Create a release based on current feature +-- +h,help! Show this help +" + + # 1) pull dev from origin + # git_do checkout "$BRANCH" + # git_do (or somth exists alredy here?) + + # Parse arguments + parse_args "$@" + + # Use current branch if no name is given + if [ "$NAME" = "" ]; then + gitflow_use_current_branch_name + fi + + # 2) Update feature with dev + echo "Rebasing $BASE_BRANCH to $BRANCH" + git_do flow feature rebase || die "Could not rebase $BRANCH which is based on $BASE_BRANCH" + + # 3) create release + git_do flow release start $NAME $BRANCH + +} + helper_finish_cleanup() { local keepmsg remotebranchdeleted localbranchdeleted diff --git a/git-flow-hotfix b/git-flow-hotfix index 0239f8a..f1e9853 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -8,9 +8,10 @@ # http://blog.avirtualhome.com/development-workflow-using-git/ # # Feel free to contribute to this project at: -# http://github.com/petervanderdoes/gitflow +# http://github.com/CJ-Systems/gitflow-cjs # # Authors: +# Copyright 2003 CJ Systems. All rights reserved. # Copyright 2012-2019 Peter van der Does. All rights reserved. # # Original Author: @@ -348,23 +349,24 @@ showcommands! Show git commands while executing them # Sanity checks require_clean_working_tree - require_branch_absent "$BRANCH" - git_do fetch -q "$ORIGIN" - require_branch "$ORIGIN/$BRANCH" + require_local_branch_absent "$BRANCH" + + git_do fetch -q "$ORIGIN" || die "Could not fetch branch '$BRANCH' from remote '$ORIGIN'." + git_remote_branch_exists "$ORIGIN/$BRANCH" # Create tracking branch - git_do checkout -b "$BRANCH" "$ORIGIN/$BRANCH" + git_do checkout -b "$BRANCH" "$ORIGIN/$BRANCH" || die "Could not create branch '$BRANCH'." echo echo "Summary of actions:" echo "- A new remote tracking branch '$BRANCH' was created" - echo "- You are now on branch '$BRANCH'" + echo "- You are now on branch '$(git_current_branch)'" echo } cmd_finish() { OPTIONS_SPEC="\ -git flow hotfix finish [-h] [-F] [-s] [-u] [-m | -f ] [-p] [-k] [-n] [-b] [-S] +git flow hotfix finish [-h] [-F] [-s] [-u] [-m | -f ] [-p] [-k] [-n] [-b | -c | -r] [-S] Finish hotfix branch -- @@ -382,8 +384,10 @@ k,[no]keep Keep branch after performing finish D,[no]force_delete Force delete hotfix branch after finish n,[no]notag Don't tag this hotfix b,[no]nobackmerge Don't back-merge master, or tag if applicable, in develop +r,releaseBackmerge Back-merge to release branch if exists S,[no]squash Squash hotfix during merge T,tagname! Use given tag name +c,cherrypick Cherry Pick to $DEVELOP_BRANCH instead of merge " local opts commit keepmsg remotebranchdeleted localbranchdeleted @@ -400,25 +404,29 @@ T,tagname! Use given tag name DEFINE_boolean 'force_delete' false "force delete hotfix branch after finish" D DEFINE_boolean 'notag' false "don't tag this hotfix" n DEFINE_boolean 'nobackmerge' false "don't back-merge $MASTER_BRANCH, or tag if applicable, in $DEVELOP_BRANCH " b + DEFINE_boolean 'releasebackmerge' false "back-merge to release branch if exists" r DEFINE_boolean 'squash' false "squash release during merge" S DEFINE_boolean 'squash-info' false "add branch info during squash" DEFINE_string 'tagname' "" "use the given tag name" T + DEFINE_boolean 'cherrypick' false "Cherry Pick to $DEVELOP_BRANCH instead of merge" c # Override defaults with values from config - gitflow_override_flag_boolean "hotfix.finish.fetch" "fetch" - gitflow_override_flag_boolean "hotfix.finish.sign" "sign" - gitflow_override_flag_boolean "hotfix.finish.push" "push" - gitflow_override_flag_boolean "hotfix.finish.keep" "keep" - gitflow_override_flag_boolean "hotfix.finish.keepremote" "keepremote" - gitflow_override_flag_boolean "hotfix.finish.keeplocal" "keeplocal" - gitflow_override_flag_boolean "hotfix.finish.force-delete" "force_delete" - gitflow_override_flag_boolean "hotfix.finish.notag" "notag" - gitflow_override_flag_boolean "hotfix.finish.nobackmerge" "nobackmerge" - gitflow_override_flag_boolean "hotfix.finish.squash" "squash" - gitflow_override_flag_boolean "hotfix.finish.squash-info" "squash_info" - gitflow_override_flag_string "hotfix.finish.signingkey" "signingkey" - gitflow_override_flag_string "hotfix.finish.message" "message" - gitflow_override_flag_string "hotfix.finish.messagefile" "messagefile" + gitflow_override_flag_boolean "hotfix.finish.fetch" "fetch" + gitflow_override_flag_boolean "hotfix.finish.sign" "sign" + gitflow_override_flag_boolean "hotfix.finish.push" "push" + gitflow_override_flag_boolean "hotfix.finish.keep" "keep" + gitflow_override_flag_boolean "hotfix.finish.keepremote" "keepremote" + gitflow_override_flag_boolean "hotfix.finish.keeplocal" "keeplocal" + gitflow_override_flag_boolean "hotfix.finish.force-delete" "force_delete" + gitflow_override_flag_boolean "hotfix.finish.notag" "notag" + gitflow_override_flag_boolean "hotfix.finish.nobackmerge" "nobackmerge" + gitflow_override_flag_boolean "hotfix.finish.releasebackmerge" "releasebackmerge" + gitflow_override_flag_boolean "hotfix.finish.squash" "squash" + gitflow_override_flag_boolean "hotfix.finish.squash-info" "squash_info" + gitflow_override_flag_string "hotfix.finish.signingkey" "signingkey" + gitflow_override_flag_string "hotfix.finish.message" "message" + gitflow_override_flag_string "hotfix.finish.messagefile" "messagefile" + gitflow_override_flag_boolean "hotfix.finish.cherrypick" "cherrypick" # Parse arguments parse_args "$@" @@ -448,6 +456,19 @@ T,tagname! Use given tag name FLAGS_keep=$FLAGS_TRUE fi + # Check that not both no merge flags were given + if flag cherrypick && flag nobackmerge; then + die "You can't use 'cherrypick' and 'nobackmerge' together." + fi + + if flag cherrypick && flag releasebackmerge; then + die "You can't use 'cherrypick' and 'releasebackmerge' together." + fi + + if flag nobackmerge && flag releasebackmerge; then + die "You can't use 'nobackmerge' && 'releasebackmerge' together." + fi + # Sanity checks require_branch "$BRANCH" require_clean_working_tree @@ -516,6 +537,42 @@ T,tagname! Use given tag name run_pre_hook "$VERSION_PREFIX$TAGNAME" "$ORIGIN" "$BRANCH" +if flag cherrypick; then +printf 'this is the cherrypick\n' +read + git_do checkout "$DEVELOP_BRANCH" || die "Could not check out branch '$DEVELOP_BRANCH'." + + local old_IFS=$IFS # save the field separator + IFS=$'\n' # new field separator, the end of line + for git_line in $(git log --format="%H %s" --reverse $MASTER_BRANCH..$BRANCH | grep -vE "^[a-z0-9]* Merge branch '[^'].*?'$"); do + local commit_hash=$(echo $git_line | cut -d" " -f1) + if [[ $(git log $DEVELOP_BRANCH --grep "$commit_hash" | wc -l) -eq 0 ]]; then + echo "\n${LIGHTGREEN}Cherry picking: $git_line${NOCOLOR}" + git_do cherry-pick -x -s $commit_hash + if [[ $? -ne 0 ]]; then + echo " +=============================================================== += Cherry pick has conflicts, steps to continue: += 1. Fix the conflicts += 2. Stage the fixed file: '${BLUE}git add ${NOCOLOR}' += 3. Continue the cherry pick: '${BLUE}git cherry-pick --continue${NOCOLOR}' += *** If fixing the conflict results in an empty commit, += you will need to run this command: '${BLUE}git commit --allow-empty${NOCOLOR}' += 4. Switch back to the hotfix branch: '${BLUE}git checkout $BRANCH${NOCOLOR}' += 5. Rerun the finish command: '${BLUE}git flow hotfix finish${NOCOLOR}' += OR run '${BLUE}git cherry-pick --abort${NOCOLOR}' to abort the cherry pick +===============================================================\n" + die "Cherry pick failed for commit: $commit_hash" + fi + else + echo "\n${LIGHTGREEN}Commit has already been Cherry Picked: $git_line${NOCOLOR}" + fi + done + IFS=$old_IFS # restore default field separator + + git_do checkout $BRANCH || die "Could not check out branch '$BRANCH'." + fi + # Try to merge into BASE. # In case a previous attempt to finish this release branch has failed, # but the merge into BASE was successful, we skip it now @@ -551,37 +608,56 @@ T,tagname! Use given tag name fi fi - if [ "$BASE_BRANCH" = "$MASTER_BRANCH" ]; then - # By default we back-merge the $MASTER_BRANCH unless the user explicitly - # stated not to do a back-merge, in that case we use the $BRANCH. - if noflag nobackmerge; then - MERGE_BRANCH="$BASE_BRANCH" - else - MERGE_BRANCH="$BRANCH" - fi - - # Try to merge into develop. + if [ "$BASE_BRANCH" = "$MASTER_BRANCH" ] && noflag nobackmerge && noflag cherrypick; then + # Try to merge into develop unless the user specified the nobackmerge option. # In case a previous attempt to finish this release branch has failed, # but the merge into develop was successful, we skip it now - if ! git_is_branch_merged_into "$MERGE_BRANCH" "$DEVELOP_BRANCH"; then + if ! git_is_branch_merged_into "$BASE_BRANCH" "$DEVELOP_BRANCH"; then + # Accounting for 'git describe', if a release is tagged + # we use the tag commit instead of the branch. + if noflag notag; then + commit="$VERSION_PREFIX$TAGNAME" + else + commit="$BASE_BRANCH" + fi + # merge master to develop git_do checkout "$DEVELOP_BRANCH" || die "Could not check out branch '$DEVELOP_BRANCH'." + git_do merge --no-ff "$commit" || die "There were merge conflicts." # TODO: What do we do now? + fi + fi - if noflag nobackmerge; then - # Accounting for 'git describe', if a release is tagged - # we use the tag commit instead of the branch. - if noflag notag; then - commit="$VERSION_PREFIX$TAGNAME" - else - commit="$BASE_BRANCH" - fi + if flag releasebackmerge; then + _releasePrefix=$(git config --get gitflow.prefix.release) + release_branches=$(git_local_branches_prefixed "$_releasePrefix") + release_branch= + # Check if there is a release branch + if [ -n "$release_branches" ]; then + # Get the release branch name + release_branch=$(echo ${release_branches} | head -n1) + # Check if release branch exists on remote + if git_remote_branch_exists "$ORIGIN/$release_branch"; then + # Try to merge into release. + # In case a previous attempt to finish this release branch has failed, + # but the merge into release was successful, we skip it now + if ! git_is_branch_merged_into "$MERGE_BRANCH" "$release_branch"; then + git_do checkout "$release_branch" || die "Could not check out branch '$release_branch'." + # Accounting for 'git describe', if a release is tagged + # we use the tag commit instead of the branch. + if noflag notag; then + commit="$VERSION_PREFIX$TAGNAME" + else + commit="$BASE_BRANCH" + fi + else + commit="$BRANCH" + fi + git_do merge --no-ff "$commit" || die "There were merge conflicts." + # TODO: What do we do now? else - commit="$BRANCH" + echo "Remote release $release_branch not found" fi - - git_do merge --no-ff "$commit" || die "There were merge conflicts." - # TODO: What do we do now? fi - fi + fi run_post_hook "$VERSION_PREFIX$TAGNAME" "$ORIGIN" "$BRANCH" @@ -589,6 +665,9 @@ T,tagname! Use given tag name if [ "$BASE_BRANCH" = "$MASTER_BRANCH" ]; then git_do push "$ORIGIN" "$DEVELOP_BRANCH" || die "Could not push branch '$DEVELOP_BRANCH' to remote '$ORIGIN'." fi + if [ -n "$release_branch" ]; then + git_do push "$ORIGIN" "$release_branch" || dir "Could not push branch '$release_branch' to remote '$ORIGIN'." + fi git_do push "$ORIGIN" "$BASE_BRANCH" || die "Could not push branch '$BASE_BRANCH' to remote '$ORIGIN'." if noflag notag; then git_do push --tags "$ORIGIN" || die "Could not push tags to remote '$ORIGIN'." @@ -633,11 +712,15 @@ T,tagname! Use given tag name if noflag notag; then echo "- The hotfix was tagged '$VERSION_PREFIX$TAGNAME'" fi - if [ "$BASE_BRANCH" = "$MASTER_BRANCH" ]; then + if flag cherrypick; then + echo "- All commits from the hotfix branch have been cherry picked into '$DEVELOP_BRANCH'" + elif [ "$BASE_BRANCH" = "$MASTER_BRANCH" ]; then [ "$commit" = "$BASE_BRANCH" ] && echo "- Master branch '$BASE_BRANCH' has been back-merged into '$DEVELOP_BRANCH'" - [ "$commit" = "$VERSION_PREFIX$TAGNAME" ] && echo "- Hotfix tag '$VERSION_PREFIX$TAGNAME' has been back-merged into '$DEVELOP_BRANCH'" + [ -n "$release_branch" ] && echo "- Hotfix tag '$VERSION_PREFIX$TAGNAME' has been back-merged into '$release_branch'" + [ "$commit" = "$VERSION_PREFIX$VERSION" ] && echo "- Hotfix tag '$VERSION_PREFIX$VERSION' has been back-merged into '$DEVELOP_BRANCH'" [ "$commit" = "$BRANCH" ] && echo "- Hotfix branch '$BRANCH' has been merged into '$DEVELOP_BRANCH'" fi + if noflag keep; then if [ $localbranchdeleted -eq $FLAGS_TRUE ]; then keepmsg="has been locally deleted" diff --git a/git-flow-init b/git-flow-init index f66031a..0ab7b19 100644 --- a/git-flow-init +++ b/git-flow-init @@ -8,9 +8,10 @@ # http://blog.avirtualhome.com/development-workflow-using-git/ # # Feel free to contribute to this project at: -# http://github.com/petervanderdoes/gitflow +# http://github.com/CJ-Systems/gitflow-cjs # # Authors: +# Copyright 2003 CJ Systems. All rights reserved. # Copyright 2012-2019 Peter van der Does. All rights reserved. # # Original Author: @@ -58,7 +59,7 @@ parse_args() { # Default entry when no SUBACTION is given cmd_default() { OPTIONS_SPEC="\ -git flow init [-h] [-d] [-f] +git flow init [-h] [-d] [-f] [-g] Setup a git repository for git flow usage. Can also be used to start a git repository. -- @@ -66,6 +67,7 @@ h,help! Show this help showcommands! Show git commands while executing them d,[no]defaults Use default branch naming conventions f,[no]force Force setting of gitflow branches, even if already configured +g,[no]sign Sign initial commit when creating a repository p,feature! Feature branches b,bugfix! Bugfix branches @@ -89,6 +91,7 @@ file= use given config file DEFINE_boolean 'local' false 'use repository config file' DEFINE_boolean 'global' false 'use global config file' DEFINE_boolean 'system' false 'use system config file' + DEFINE_boolean 'sign' false 'sign initial commit when creating a repository' g DEFINE_string 'file' "" 'use given config file' DEFINE_string 'feature' "" 'feature branches' p DEFINE_string 'bugfix' "" 'bugfix branches' b @@ -116,8 +119,8 @@ file= use given config file fi if git_config_bool_exists "user.useconfigonly"; then - user_email=$(git config --get user.email) - user_name=$(git config --get user.name) + user_email=$(git config --get user.email || echo $GIT_AUTHOR_EMAIL) + user_name=$(git config --get user.name || echo $GIT_AUTHOR_NAME) if [ -z "${user_email}" ] || [ -z "${user_name}" ]; then die "Configuration useconfigonly is set but no name and/or email was set" fi @@ -259,8 +262,13 @@ file= use given config file local created_gitflow_branch=0 if ! git rev-parse --quiet --verify HEAD >/dev/null 2>&1; then git_do symbolic-ref HEAD "refs/heads/$master_branch" - git_do commit --allow-empty --quiet -m "Initial commit" - created_gitflow_branch=1 + if flag sign; then + git_do commit --allow-empty --gpg-sign --quiet -m "initial commit" + created_gitflow_branch=1 + else + git_do commit --allow-empty --quiet -m "initial commit" + created_gitflow_branch=1 + fi fi # Creation of master @@ -388,7 +396,7 @@ file= use given config file [ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion} git_do config $gitflow_config_option gitflow.prefix.support "$prefix" fi - + # Version tag prefix if ! git config --get gitflow.prefix.versiontag >/dev/null 2>&1 || flag force; then if [ "$FLAGS_tag" != "" ]; then diff --git a/git-flow-log b/git-flow-log index a73cbe8..2d6da42 100644 --- a/git-flow-log +++ b/git-flow-log @@ -8,9 +8,10 @@ # http://blog.avirtualhome.com/development-workflow-using-git/ # # Feel free to contribute to this project at: -# http://github.com/petervanderdoes/gitflow +# http://github.com/CJ-Systems/gitflow-cjs # # Authors: +# Copyright 2003 CJ Systems. All rights reserved. # Copyright 2012-2019 Peter van der Does. All rights reserved. # # Original Author: @@ -48,7 +49,7 @@ usage() { OPTIONS_SPEC="\ git flow log -shows current branch log compared to develop +shows current branch log compared to base branch 'git help log' for arguments -- " @@ -69,7 +70,7 @@ cmd_list() { OPTIONS_SPEC="\ git flow feature log [] -Show log on branch since the fork of branch +Show log on current branch since the fork of base branch Options come from git log -- h,help! Show this help diff --git a/git-flow-release b/git-flow-release index 2daed24..3caaf08 100644 --- a/git-flow-release +++ b/git-flow-release @@ -8,9 +8,10 @@ # http://blog.avirtualhome.com/development-workflow-using-git/ # # Feel free to contribute to this project at: -# http://github.com/petervanderdoes/gitflow +# http://github.com/CJ-Systems/gitflow-cjs # # Authors: +# Copyright 2003 CJ Systems. All rights reserved. # Copyright 2012-2019 Peter van der Does. All rights reserved. # # Original Author: diff --git a/git-flow-support b/git-flow-support index 8328ff0..f7bb3ec 100644 --- a/git-flow-support +++ b/git-flow-support @@ -8,9 +8,10 @@ # http://blog.avirtualhome.com/development-workflow-using-git/ # # Feel free to contribute to this project at: -# http://github.com/petervanderdoes/gitflow +# http://github.com/CJ-Systems/gitflow-cjs # # Authors: +# Copyright 2003 CJ Systems. All rights reserved. # Copyright 2012-2019 Peter van der Does. All rights reserved. # # Original Author: diff --git a/git-flow-version b/git-flow-version index 44359cd..64a480f 100644 --- a/git-flow-version +++ b/git-flow-version @@ -8,9 +8,10 @@ # http://blog.avirtualhome.com/development-workflow-using-git/ # # Feel free to contribute to this project at: -# http://github.com/petervanderdoes/gitflow +# http://github.com/CJ-Systems/gitflow-cjs # # Authors: +# Copyright 2003 CJ Systems. All rights reserved. # Copyright 2012-2019 Peter van der Does. All rights reserved. # # Original Author: @@ -38,7 +39,7 @@ # -GITFLOW_VERSION=2.1.0 +GITFLOW_VERSION=2.2.0 initialize() { # A function can not be empty. Comments count as empty. diff --git a/gitflow-common b/gitflow-common index 0084f85..dcd78e3 100644 --- a/gitflow-common +++ b/gitflow-common @@ -8,9 +8,10 @@ # http://blog.avirtualhome.com/development-workflow-using-git/ # # Feel free to contribute to this project at: -# http://github.com/petervanderdoes/gitflow +# http://github.com/CJ-Systems/gitflow-cjs # # Authors: +# Copyright 2003 CJ Systems. All rights reserved. # Copyright 2012-2019 Peter van der Does. All rights reserved. # # Original Author: @@ -810,3 +811,22 @@ run_post_hook() { flags_help() { eval "$( echo "$OPTIONS_SPEC" | git rev-parse --parseopt -- "-h" || echo exit $? )" } + +# +# Color constants +# +echo_color_support() { + local echo_path=$(which echo) + local echo_out=$($echo_path -e) + if [[ $echo_out == "" ]]; then + alias echo="$echo_path -e " + BLUE="\e[34m" + LIGHTGREEN="\e[92m" + NOCOLOR="\e[0m" + else + BLUE="" + LIGHTGREEN="" + NOCOLOR="" + fi +} +echo_color_support \ No newline at end of file