Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dist root #1

Merged
merged 2 commits into from May 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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