From c75a2a594a29dc4633dc1bf1c7c5d9bb55be022b Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Thu, 19 Jan 2017 11:37:31 +0100 Subject: [PATCH] bashify --- shell/go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/shell/go b/shell/go index 5f20421..23c8b78 100644 --- a/shell/go +++ b/shell/go @@ -3,16 +3,16 @@ _go-installed() { } _within-go-project() { - local check_dir=$PWD - local next_check_dir=${check_dir%/*} + local check_dir="$PWD" + local next_check_dir="${check_dir%/*}" - while [ "$next_check_dir" != "" ]; do - if [ -d "$check_dir/.gopath" ]; then + while [[ "$next_check_dir" != "" ]]; do + if [[ -d "$check_dir/.gopath" ]]; then echo "$check_dir/.gopath" return - elif [ -f "$check_dir/.gopath" ]; then + elif [[ -f "$check_dir/.gopath" ]]; then local gopath="$(cat "$check_dir/.gopath")" - if [ -z "$gopath" ]; then + if [[ -z "$gopath" ]]; then echo "$check_dir" else echo "$gopath" @@ -21,7 +21,7 @@ _within-go-project() { fi check_dir="$next_check_dir" - next_check_dir=${check_dir%/*} + next_check_dir="${check_dir%/*}" done false