From 8ac1c210f248a3eb13d990e32b3675c35cc38af3 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Mon, 18 Apr 2016 08:40:01 -0400 Subject: [PATCH] use gx for package management --- build.sh | 25 +++++++++++++++++++++++-- package.json | 8 +++++++- srnd.go | 2 +- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index ebdca59..bdd1f72 100755 --- a/build.sh +++ b/build.sh @@ -16,18 +16,39 @@ for arg in $@ ; do esac done +rev="QmSLsdX9BQ1f9sBeuMeLnrmFEWQiNJG9nRmgi4Pua2Ui3y" + +_next="" # check for build flags for arg in $@ ; do case $arg in "--disable-redis") tags="$tags -tags disable_redis" ;; + "--revision") + _next="rev" + ;; + "--revision=*") + rev=$(echo $arg | cut -d'=' -f2) + ;; + *) + if [ "x$_next" == "xrev" ] ; then + rev="$arg" + fi esac done +if [ "x$rev" == "x" ] ; then + echo "revision not specified" + exit 1 +fi + cd $root export GOPATH=$root/go mkdir -p $GOPATH -go get -v -u $tags github.com/majestrate/srndv2 -cp -a $GOPATH/bin/srndv2 $root +echo "obtaining gx" +go get -v github.com/whyrusleeping/gx-go +gx install --global +go get -v gx/ipfs/$rev/srndv2 +cp $GOPATH/bin/srndv2 $root echo "Built" diff --git a/package.json b/package.json index 69a632d..384ba9a 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,15 @@ "author": "jeff", "version": "0.0.0", "gxDependencies": [ + { + "author": "jeff", + "name": "srndv2", + "hash": "QmSLsdX9BQ1f9sBeuMeLnrmFEWQiNJG9nRmgi4Pua2Ui3y", + "version": "0.0.0" + } ], "language": "go", "issues_url": "https://github.com/majestrate/nntpchan", "gx_version": "0.4.0", "gx": {} -} +} \ No newline at end of file diff --git a/srnd.go b/srnd.go index e36dbac..e6fd691 100644 --- a/srnd.go +++ b/srnd.go @@ -2,7 +2,7 @@ package main import ( "fmt" - "github.com/majestrate/srndv2/src/srnd" + "gx/ipfs/QmSLsdX9BQ1f9sBeuMeLnrmFEWQiNJG9nRmgi4Pua2Ui3y/srndv2/src/srnd" "log" "os" "os/signal"