whatev
parent
622ceaa922
commit
b4ea5e108f
Binary file not shown.
17
sync.sh
17
sync.sh
|
|
@ -27,14 +27,23 @@ function main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function install() {
|
function install() {
|
||||||
|
if ! go version; then
|
||||||
|
echo "Must install go" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
export GOFLAGS=""
|
||||||
mkdir -p "$GOPATH/bin/$(uname)"
|
mkdir -p "$GOPATH/bin/$(uname)"
|
||||||
for i in ncw/rclone restic/restic; do
|
for i in ncw/rclone restic/restic; do
|
||||||
local b="${i##*/}"
|
local b="${i##*/}"
|
||||||
if [ -e "$GOPATH/bin/$(uname)/$b" ]; then
|
if [ -e "$GOPATH/bin/$(uname)/$b" ]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
go get -u "github.com/$i" || true
|
mkdir -p $GOPATH/src/github.com/${i%/*}
|
||||||
pushd "$GOPATH/src/github.com/$i"
|
#go get -u "github.com/$i" || true
|
||||||
|
pushd "$GOPATH/src/github.com/${i%/*}"
|
||||||
|
git clone --depth 1 --branch master https://github.com/$i
|
||||||
|
cd ${i##*/}
|
||||||
|
go get ./...
|
||||||
case "$i" in
|
case "$i" in
|
||||||
restic* )
|
restic* )
|
||||||
go run build.go
|
go run build.go
|
||||||
|
|
@ -116,7 +125,9 @@ function restore() {
|
||||||
fi
|
fi
|
||||||
mv "$HOME/$path-restore" "$HOME/$path"
|
mv "$HOME/$path-restore" "$HOME/$path"
|
||||||
done
|
done
|
||||||
clean_remote
|
if [ -z "${DIRTY:-}" ]; then
|
||||||
|
clean_remote
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function clean_remote() {
|
function clean_remote() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue