mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-18 18:56:25 +00:00
Don't install node explicitly on distribute.sh
It's now done automatically as part of npm install
This commit is contained in:
parent
eb27b8d860
commit
5226e7db16
@ -16,7 +16,6 @@
|
||||
"bin": {
|
||||
"resin": "./bin/resin"
|
||||
},
|
||||
"bundled_engine": "v0.12.0",
|
||||
"scripts": {
|
||||
"prepublish": "gulp build",
|
||||
"test": "gult test",
|
||||
|
@ -1,8 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
NODE_DIST_URL="http://nodejs.org/dist"
|
||||
CURL="curl -#"
|
||||
|
||||
# http://stackoverflow.com/questions/1955505/parsing-json-with-sed-and-awk
|
||||
function parse_json() {
|
||||
echo $1 | sed -e 's/[{}]/''/g' | awk -F=':' -v RS=',' "\$1~/\"$2\"/ {print}" | sed -e "s/\"$2\"://" | tr -d "\n\t" | sed -e 's/\\"/"/g' | sed -e 's/\\\\/\\/g' | sed -e 's/^[ \t]*//g' | sed -e 's/^"//' -e 's/"$//'
|
||||
@ -11,7 +8,6 @@ function parse_json() {
|
||||
PACKAGE_JSON=`cat package.json`
|
||||
VERSION=$(parse_json "$PACKAGE_JSON" version)
|
||||
NAME=$(parse_json "$PACKAGE_JSON" name)
|
||||
NODE_VERSION=$(parse_json "$PACKAGE_JSON" bundled_engine)
|
||||
|
||||
function print_banner() {
|
||||
local message=$1
|
||||
@ -21,32 +17,6 @@ function print_banner() {
|
||||
echo ""
|
||||
}
|
||||
|
||||
function download_node() {
|
||||
local os=$1
|
||||
local arch=$2
|
||||
local version=$3
|
||||
local output=$4
|
||||
|
||||
local remote_package="node-$version-$os-$arch"
|
||||
local package="node-$os-$arch"
|
||||
|
||||
print_banner "Downloading $remote_package"
|
||||
|
||||
mkdir -p $output
|
||||
|
||||
if [ "$os" == "win32" ]; then
|
||||
if [ "$arch" == "x86" ]; then
|
||||
$CURL $NODE_DIST_URL/$version/node.exe -o $output/$package.exe
|
||||
else
|
||||
$CURL $NODE_DIST_URL/$version/$arch/node.exe -o $output/$package.exe
|
||||
fi
|
||||
else
|
||||
$CURL $NODE_DIST_URL/$version/$remote_package.tar.gz | tar xz -C $output/
|
||||
cp $output/$remote_package/bin/node $output/$package.bin
|
||||
rm -rf $output/$remote_package
|
||||
fi
|
||||
}
|
||||
|
||||
function distribute() {
|
||||
local os=$1
|
||||
local arch=$2
|
||||
@ -61,8 +31,6 @@ function distribute() {
|
||||
cp -vrf lib build/$package
|
||||
cp -vrf package.json build/$package
|
||||
|
||||
node ./node_modules/node-binary/bin/cli.js download $NODE_VERSION build/$package/bin/node --arch $arch --os $os
|
||||
|
||||
print_banner "Running npm install"
|
||||
|
||||
cd build/$package
|
||||
|
Loading…
Reference in New Issue
Block a user