mirror of
https://github.com/lloeki/dotfiles.git
synced 2025-12-06 07:24:39 +01:00
go link package into gopath
This commit is contained in:
parent
c75a2a594a
commit
e7eaa93de2
1 changed files with 11 additions and 0 deletions
11
shell/go
11
shell/go
|
|
@ -62,4 +62,15 @@ _gopath() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_go-package() {
|
||||||
|
git remote get-url origin | perl -ne '/@(.*).git/ and { $_ = "$1" and s/:/\// and print }'
|
||||||
|
}
|
||||||
|
|
||||||
|
_link-go-package() {
|
||||||
|
local pkgn="$(_go-package)"
|
||||||
|
local src="$(_within-go-project)/src"
|
||||||
|
mkdir -p "$src/$(dirname $pkgn)"
|
||||||
|
ln -sf "$PWD" "$src/$pkgn"
|
||||||
|
}
|
||||||
|
|
||||||
# vim: ft=sh
|
# vim: ft=sh
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue