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