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
e5163904
Commit
e5163904
authored
Sep 12, 2013
by
zeke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle semver match failures
parent
c1f13bf0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
common.sh
bin/common.sh
+1
-2
compile
bin/compile
+4
-3
No files found.
bin/common.sh
View file @
e5163904
...
...
@@ -3,8 +3,7 @@
# fail fast
set
-e
# Uncomment the line below to enable debugging when
# working on the buildpack
# Uncomment the line below to enable debugging
# set -x
download_and_install_node
()
{
...
...
bin/compile
View file @
e5163904
...
...
@@ -30,12 +30,13 @@ if ! test $requested_version; then
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
""
)
default_satisfies
=
$(
$bp_dir
/vendor/semver/bin/semver
-v
"
$stable_version
"
-r
"
$requested_version
"
||
echo
""
)
if
test
$default_satisfies
;
then
status
"Latest stable node v
$stable_version
satisfies engines.node:
$requested
"
status
"Latest stable node v
$stable_version
satisfies engines.node:
$requested
_version
"
node_version
=
$stable_version
else
# Fetch all versions of node from nodejs.org/dist and format them into
# a string that the semver binary will appreciate.
# e.g. semver -v "0.10.0" -v "0.10.1" -v "0.10.2" -r ">0.8"
...
...
@@ -45,7 +46,7 @@ else
args
=
"
${
args
}
-r
\"
${
requested_version
}
\"
"
# Find all versions that satisfy.
satisfying_versions
=
$(
eval
$bp_dir
/vendor/semver/bin/semver
${
args
})
satisfying_versions
=
$(
eval
$bp_dir
/vendor/semver/bin/semver
${
args
}
||
echo
""
)
# Use the latest one.
node_version
=
$(
echo
"
$satisfying_versions
"
|
tail
-n
1
)
...
...
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