mirror of https://github.com/parazyd/arm-sdk.git
Allow downloading other files with the blend param.
This commit is contained in:
parent
9455ee1b94
commit
7099be9155
13
sdk
13
sdk
|
|
@ -88,7 +88,6 @@ load() {
|
|||
)
|
||||
|
||||
blend_map=(
|
||||
"dowse" "https://github.com/dyne/dowse/raw/master/ops/dowse.blend"
|
||||
"decode" "../decode.blend"
|
||||
"maemo" "../maemo.blend"
|
||||
)
|
||||
|
|
@ -103,14 +102,17 @@ load() {
|
|||
|
||||
blendlib="${blend_map[$blend]}"
|
||||
|
||||
if [[ "$blendlib" =~ '^http' ]]; then
|
||||
if [[ -z "$blendlib" ]]; then
|
||||
if [[ "$blend" =~ '^http' ]]; then
|
||||
notice "grabbing blend from the internetz"
|
||||
wget -O "$R/extra/blends/$(basename $blendlib)" "$blendlib"
|
||||
blendlib="$R/extra/blends/$(basename $blendlib)"
|
||||
dlpath="$R/extra/blends/$(basename $blend)"
|
||||
wget -O "$dlpath" "$blend"
|
||||
sed 1q "$dlpath" | grep -q '^#!/usr/bin/env zsh' && blendlib="$dlpath"
|
||||
fi
|
||||
|
||||
if [[ -z "$blendlib" ]]; then
|
||||
notice "trying to parse an unknown blend"
|
||||
[[ -n "$dlpath" ]] && blend="$dlpath"
|
||||
act "trying to parse an unknown blend"
|
||||
# Check if it's a Dockerfile
|
||||
if grep -qi '^FROM ' "$blend"; then
|
||||
act "The blend is a Dockerfile"
|
||||
|
|
@ -136,6 +138,7 @@ __EOF__
|
|||
blendlib="$R/$(basename ${blend}).blend"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
[[ -f $blendlib ]] || { act "no blend specified" }
|
||||
source $boardlib && act "$device_name build script loaded"
|
||||
|
|
|
|||
Loading…
Reference in New Issue