commit e442d2b4d5d0aecb5754aa74a03de05aec66c464 parent 5f8b34e732eb0ef0dd6ad62ea5ea64e2987da007 Author: krasjet <nil@krj.st> Date: Sun, 12 Jul 2020 19:03:53 -0700 fix color code across ssh Diffstat:
M | grm | | | 10 | +++++++--- |
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/grm b/grm @@ -178,14 +178,18 @@ grm_recompile() { grm_info() { repo_name=$1 repo_dir="${repos_root}/${repo_name}.git" - [ -d "$repo_dir" ] || { echo "can't find repo named $repo_name"; exit 1; } + [ -d "$repo_dir" ] || { echo "can't find repo named $repo_name"; exit 1; } echo "name: $repo_name" + RED='\e[91m' + GREEN='\e[92m' + RESET='\e[0m' + if [ -e "${repo_dir}/git-daemon-export-ok" ]; then - printf "visibility: \x1b[92mpublic\x1b[0m\n" + printf "%s\n" "visibility: ${GREEN}public${RESET}" else - printf "visibility: \x1b[91mprivate\x1b[0m\n" + printf "%s\n" "visibility: ${RED}private${RESET}\n" fi [ -f "${repo_dir}/description" ] && \