diff --git a/.gitignore b/.gitignore index 7494d8349a..dd342440b8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .DS_Store build/ +node/ node_modules/ vendor/ *.xcodeproj diff --git a/atom.gyp b/atom.gyp index a5b1d9f2d0..8064ced50f 100644 --- a/atom.gyp +++ b/atom.gyp @@ -157,7 +157,14 @@ 'files': [ 'browser/default_app', ], - } + }, + { + # Copy node binary for worker process support. + 'destination': '<(PRODUCT_DIR)/<(product_name).app/Contents/Resources', + 'files': [ + 'node/node', + ], + }, ], 'postbuilds': [ { diff --git a/script/update b/script/update index 503fb6374f..1b0ba46c3a 100755 --- a/script/update +++ b/script/update @@ -4,6 +4,8 @@ set -e cd "$(dirname "$0")/.." +./script/update-node v0.10.5 + gyp --depth . atom.gyp \ -Ivendor/brightray/brightray.gypi \ -Dtarget_arch=ia32 \ diff --git a/script/update-node b/script/update-node new file mode 100755 index 0000000000..54edd321ce --- /dev/null +++ b/script/update-node @@ -0,0 +1,31 @@ +#!/bin/bash + +set -e + +cd "$(dirname $0)/.." + +NODE_VERSION=v0.10.5 +[ -z $1 ] || NODE_VERSION=$1 + +# Test whether we need update. +if [ -f "node/node" ] && [[ `node/node --version` == $NODE_VERSION ]] ; then + exit 0 +fi + +case $OSTYPE in + darwin*) NODE_PLATFORM=darwin ;; + linux*) NODE_PLATFORM=linux ;; + *) echo "Unsupported platform $OSTYPE" && exit 1 ;; +esac + +NODE_DIST_NAME="node-$NODE_VERSION-$NODE_PLATFORM-x86" + +# Download node and untar +NODE_TARBALL_URL="https://gh-contractor-zcbenz.s3.amazonaws.com/node/dist/$NODE_DIST_NAME.tar.gz" +TARGET_DIR='node' +[ -d "$TARGET_DIR" ] || mkdir "$TARGET_DIR" +cd "$TARGET_DIR" +curl -fsSkL $NODE_TARBALL_URL | tar -zx || exit 1 + +cp "$NODE_DIST_NAME/bin/node" . +rm -rf "$NODE_DIST_NAME" diff --git a/vendor/node b/vendor/node index 5c651db8ff..bb77a4da8e 160000 --- a/vendor/node +++ b/vendor/node @@ -1 +1 @@ -Subproject commit 5c651db8ff28c710bedecd0599ce8a1249ae843f +Subproject commit bb77a4da8e864bf68672912ab28277e4a5812491