mirror of
https://github.com/wahyd4/gvm.git
synced 2026-08-25 04:36:28 +10:00
Allow managing pkgset under local folder.
While replacing pakcageset name with "--local", the packageset information will be managed under some/local/repo/.gvm_local folder, and add the root path of repository as the first path in GOPATH and PATH. This makes the repository more portable since we don't store all the go-installed package files under $HOME/.gvm . The repository root path for gvm is definded as $PWD while "pkgset create --local" . When "pkgset list" under some configured local repository, it will list the root path as the first packageset, and marked with "L".
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
function find_local_pkgset
|
||||
{
|
||||
local TOPFILE=.gvm_local
|
||||
if [ -d $TOPFILE ] ; then
|
||||
PWD= /bin/pwd
|
||||
else
|
||||
local HERE=$PWD
|
||||
T=
|
||||
while [ \( ! \( -d $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
|
||||
\cd ..
|
||||
T=`PWD= /bin/pwd`
|
||||
done
|
||||
\cd $HERE
|
||||
if [ -d "$T/$TOPFILE" ]; then
|
||||
echo $T
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user