master
bel 2021-09-08 14:10:10 -06:00
parent 622ceaa922
commit b4ea5e108f
2 changed files with 14 additions and 3 deletions

17
sync.sh
View File

@ -27,14 +27,23 @@ function main() {
}
function install() {
if ! go version; then
echo "Must install go" >&2
exit 1
fi
export GOFLAGS=""
mkdir -p "$GOPATH/bin/$(uname)"
for i in ncw/rclone restic/restic; do
local b="${i##*/}"
if [ -e "$GOPATH/bin/$(uname)/$b" ]; then
continue
fi
go get -u "github.com/$i" || true
pushd "$GOPATH/src/github.com/$i"
mkdir -p $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
restic* )
go run build.go
@ -116,7 +125,9 @@ function restore() {
fi
mv "$HOME/$path-restore" "$HOME/$path"
done
clean_remote
if [ -z "${DIRTY:-}" ]; then
clean_remote
fi
}
function clean_remote() {