mirror of
https://github.com/lloeki/dotfiles.git
synced 2025-12-06 07:24:39 +01:00
bashify
This commit is contained in:
parent
e6db52d09a
commit
c75a2a594a
1 changed files with 7 additions and 7 deletions
14
shell/go
14
shell/go
|
|
@ -3,16 +3,16 @@ _go-installed() {
|
||||||
}
|
}
|
||||||
|
|
||||||
_within-go-project() {
|
_within-go-project() {
|
||||||
local check_dir=$PWD
|
local check_dir="$PWD"
|
||||||
local next_check_dir=${check_dir%/*}
|
local next_check_dir="${check_dir%/*}"
|
||||||
|
|
||||||
while [ "$next_check_dir" != "" ]; do
|
while [[ "$next_check_dir" != "" ]]; do
|
||||||
if [ -d "$check_dir/.gopath" ]; then
|
if [[ -d "$check_dir/.gopath" ]]; then
|
||||||
echo "$check_dir/.gopath"
|
echo "$check_dir/.gopath"
|
||||||
return
|
return
|
||||||
elif [ -f "$check_dir/.gopath" ]; then
|
elif [[ -f "$check_dir/.gopath" ]]; then
|
||||||
local gopath="$(cat "$check_dir/.gopath")"
|
local gopath="$(cat "$check_dir/.gopath")"
|
||||||
if [ -z "$gopath" ]; then
|
if [[ -z "$gopath" ]]; then
|
||||||
echo "$check_dir"
|
echo "$check_dir"
|
||||||
else
|
else
|
||||||
echo "$gopath"
|
echo "$gopath"
|
||||||
|
|
@ -21,7 +21,7 @@ _within-go-project() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
check_dir="$next_check_dir"
|
check_dir="$next_check_dir"
|
||||||
next_check_dir=${check_dir%/*}
|
next_check_dir="${check_dir%/*}"
|
||||||
done
|
done
|
||||||
|
|
||||||
false
|
false
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue