Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
heroku-buildpack-nodejs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
heroku-buildpack-nodejs
Commits
bb5f09e8
Commit
bb5f09e8
authored
Sep 12, 2013
by
zeke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove some comments, add some comments
parent
51a28bdb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
22 deletions
+14
-22
common.sh
bin/common.sh
+8
-16
compile
bin/compile
+6
-6
No files found.
bin/common.sh
View file @
bb5f09e8
...
...
@@ -8,13 +8,10 @@ set -e
download_and_install_node
()
{
version
=
"
$1
"
status
"Downloading node
$version
"
status
"Downloading and installing node v
$version
"
node_url
=
"http://s3pository.heroku.com/node/v
$version
/node-v
$version
-linux-x64.tar.gz"
curl
$node_url
-s
-o
- |
tar
xzf -
-C
$build_dir
mv
$build_dir
/node-v
$version
-linux-x64
$build_dir
/node
status
"Adding node and npm to
\$
PATH"
chmod
+x
$build_dir
/node/bin/
*
PATH
=
$PATH
:
$build_dir
/node/bin
}
...
...
@@ -44,18 +41,15 @@ error() {
exit
1
}
function
status
()
{
status
()
{
echo
"----->
$*
"
}
function
mktmpdir
()
{
dir
=
$(
mktemp
-t
node-
$1
-XXXX
)
rm
-rf
$dir
mkdir
-p
$dir
echo
$dir
}
function
indent
()
{
# sed -l basically makes sed replace and buffer through stdin to stdout
# so you get updates while the command runs and dont wait for the end
# e.g. npm install | indent
indent
()
{
c
=
's/^/ /'
case
$(
uname
)
in
Darwin
)
sed
-l
"
$c
"
;;
...
...
@@ -64,7 +58,5 @@ function indent() {
}
function
cat_npm_debug_log
()
{
if
[
-f
$BUILD_DIR
/npm-debug.log
]
;
then
cat
$BUILD_DIR
/npm-debug.log
fi
}
\ No newline at end of file
[
-f
$build_dir
/npm-debug.log
]
&&
cat
$build_dir
/npm-debug.log
}
bin/compile
View file @
bb5f09e8
...
...
@@ -8,9 +8,10 @@ stable_version="0.10.18"
source
$bp_dir
/bin/common.sh
# Output debug info on exit
#
trap cat_npm_debug_log EXIT
trap
cat_npm_debug_log EXIT
status
"Downloading node version
$stable_version
"
# Bootstrap the build process with latest stable version of node
# We'll use it to parse package.json and do semver detection
download_and_install_node
$stable_version
# Is a node version specified in package.json?
...
...
@@ -20,21 +21,21 @@ determine_requested_version() {
}
requested_version
=
$(
determine_requested_version
)
# Give a warning if
no node engine is
specified
# Give a warning if
engines.node is un
specified
if
!
test
$requested_version
;
then
node_version
=
$stable_version
echo
echo
"WARNING: No node version specified in package.json, see:"
| indent
echo
"https://devcenter.heroku.com/articles/nodejs-support#versions"
| indent
echo
status
"
Using latest stable node version
$stable_version
"
status
"
Defaulting to node v
$stable_version
(latest stable)
"
else
# Does the already-downloaded stable version of node satisfy the requested version?
default_satisfies
=
$(
node
$bp_dir
/vendor/semver/bin/semver
-v
"
${
stable_version
}
"
-r
"
${
requested_version
}
"
||
echo
""
)
if
test
$default_satisfies
;
then
status
"Using
latest stable node version
$stable_version
"
status
"Using
node v
$stable_version
"
node_version
=
$stable_version
else
# Find all available versions from nodejs.org/dist
...
...
@@ -50,7 +51,6 @@ else
node_version
=
$(
echo
$evaluated_versions
|
tail
-n
1
)
if
test
$node_version
;
then
status
"Using node version
$node_version
"
download_and_install_node
$node_version
else
error
"Requested node version
${
requested_version
}
not found among available versions on nodejs.org/dist"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment