Skip to content

Commit

Permalink
Merge pull request #1 from lgierth/dist-root
Browse files Browse the repository at this point in the history
Dist root
  • Loading branch information
whyrusleeping committed May 17, 2016
2 parents f6cd6d4 + 888cdea commit cf36142
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/
22 changes: 12 additions & 10 deletions dist_get
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,23 @@ get_go_vars() {
}

mkurl() {
local name="$1"
local vers="$2"
local archive="$3"
local root="$1"
local name="$2"
local vers="$3"
local archive="$4"

local govars=$(get_go_vars)

echo "http://dist.ipfs.io/$name/$vers/${name}_${vers}_$govars.$archive"
echo "https://ipfs.io$root/$name/$vers/${name}_${vers}_$govars.$archive"
}

distname="$1"
outpath="$2"
version="$3"
distroot="$1"
distname="$2"
outpath="$3"
version="$4"

if [ -z "$distname" ] || [ -z "$outpath" ] || [ -z "$version" ]; then
die "usage: dist_get <distname> <outpath> <version>"
if [ -z "$distroot" ] || [ -z "$distname" ] || [ -z "$outpath" ] || [ -z "$version" ]; then
die "usage: dist_get <distroot> <distname> <outpath> <version>"
fi

if [ ${version:0:1} != "v" ]; then
Expand Down Expand Up @@ -132,7 +134,7 @@ esac

mkdir -p bin/tmp

url=$(mkurl "$distname" "$version" "$archive")
url=$(mkurl "$distroot" "$distname" "$version" "$archive")
tmpfi="bin/tmp/$distname.$archive"

download "$url" "$tmpfi"
Expand Down

0 comments on commit cf36142

Please sign in to comment.