forked from hyperledger-archives/fabric
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paths390xVendor.sh
executable file
·36 lines (29 loc) · 888 Bytes
/
s390xVendor.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
if [ -z $GOPATH ]; then
echo GOPATH must be set
exit
fi
if [ "$1" != "restore" ]; then
GOLANGLIST=`ls -d vendor/**|grep -v github|grep -v json`
if [ -z "$GOLANGLIST" ]; then
echo "vendor subdirectories already relocated to $GOPATH/src"
exit
fi
GITHUBLIST=`ls -d vendor/github.com/**`
echo -n "Relocate vendor subdirectories to $GOPATH/src ... "
mv $GOLANGLIST $GOPATH/src/
mv $GITHUBLIST $GOPATH/src/github.com/
rmdir vendor/github.com
else
GOLANGLIST=`ls -d $GOPATH/src/**|grep -v github`
if [ -z "$GOLANGLIST" ]; then
echo "vendor subdirectories already restored from $GOPATH/src"
exit
fi
GITHUBLIST=`ls -d $GOPATH/src/github.com/**|grep -v openblockchain`
echo -n "Restore vendor subdirectories from $GOPATH/src ... "
mkdir vendor/github.com
mv $GOLANGLIST vendor/
mv $GITHUBLIST vendor/github.com/
fi
echo "Done"