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
396ed485
Commit
396ed485
authored
Dec 02, 2013
by
zeke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle semver ranges that contain spaces
parent
cfeefc25
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
2 deletions
+21
-2
compile
bin/compile
+1
-2
test
bin/test
+7
-0
README.md
test/range-with-space/README.md
+1
-0
package.json
test/range-with-space/package.json
+12
-0
No files found.
bin/compile
View file @
396ed485
...
...
@@ -19,8 +19,7 @@ trap cat_npm_debug_log ERR
semver_range
=
$(
cat
$build_dir
/package.json |
$bp_dir
/vendor/jq
-r
.engines.node
)
# Resolve node version using semver.io
semver_url
=
http://semver.io/node/resolve/
$semver_range
node_version
=
$(
curl
--silent
$semver_url
)
node_version
=
$(
curl
--silent
--get
--data-urlencode
"range=
${
semver_range
}
"
http://semver.io/node/resolve
)
# Recommend using semver ranges in a safe manner
if
[
"
$semver_range
"
==
"null"
]
;
then
...
...
bin/test
View file @
396ed485
...
...
@@ -35,6 +35,13 @@ testDangerousRangeGreaterThan() {
assertCapturedSuccess
}
testRangeWithSpace
()
{
compile
"range-with-space"
assertCaptured
"Requested node range: >= 0.8.x"
assertCaptured
"Resolved node version: 0.10."
assertCapturedSuccess
}
testStableVersion
()
{
compile
"stable-node"
assertNotCaptured
"PRO TIP: Avoid using semver"
...
...
test/range-with-space/README.md
0 → 100644
View file @
396ed485
A fake README, to keep npm from polluting stderr.
\ No newline at end of file
test/range-with-space/package.json
0 → 100644
View file @
396ed485
{
"name"
:
"node-buildpack-test-app"
,
"version"
:
"0.0.1"
,
"description"
:
"node buildpack integration test app"
,
"repository"
:
{
"type"
:
"git"
,
"url"
:
"http://github.com/example/example.git"
},
"engines"
:
{
"node"
:
">= 0.8.x"
}
}
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