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
da19bdb7
Commit
da19bdb7
authored
Jul 11, 2017
by
Jeremy Morrell
Committed by
Jeremy Morrell
Jul 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch yarn over to using nodebin
parent
24e2f931
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
22 deletions
+24
-22
binaries.sh
lib/binaries.sh
+7
-6
environment.sh
lib/environment.sh
+17
-0
json.sh
lib/json.sh
+0
-16
No files found.
lib/binaries.sh
View file @
da19bdb7
...
...
@@ -10,15 +10,16 @@ needs_resolution() {
install_yarn
()
{
local dir
=
"
$1
"
local
version
=
"
$2
"
local
number
local
url
if
needs_resolution
"
$version
"
;
then
echo
"Resolving yarn version
${
version
:-
(latest)
}
via semver.io..."
local
version
=
$(
curl
--silent
--get
--retry
5
--retry-max-time
15
--data-urlencode
"range=
${
version
}
"
https://semver.herokuapp.com/yarn/resolve
)
echo
"Resolving yarn version
${
version
:-
(latest)
}
..."
if
!
read
number url < <
(
curl
--silent
--get
--retry
5
--retry-max-time
15
--data-urlencode
"range=
$version
"
"https://nodebin.herokai.com/v1/yarn/
$platform
/latest.txt"
)
;
then
echo
"Unable to resolve; does that version exist?"
&&
false
fi
echo
"Downloading and installing yarn (
$version
)..."
local
download_url
=
"https://yarnpkg.com/downloads/
$version
/yarn-v
$version
.tar.gz"
local
code
=
$(
curl
"
$download_url
"
-L
--silent
--fail
--retry
5
--retry-max-time
15
-o
/tmp/yarn.tar.gz
--write-out
"%{http_code}"
)
echo
"Downloading and installing yarn (
$number
)..."
local
code
=
$(
curl
"
$url
"
-L
--silent
--fail
--retry
5
--retry-max-time
15
-o
/tmp/yarn.tar.gz
--write-out
"%{http_code}"
)
if
[
"
$code
"
!=
"200"
]
;
then
echo
"Unable to download yarn:
$code
"
&&
false
fi
...
...
lib/environment.sh
View file @
da19bdb7
get_os
()
{
uname
|
tr
A-Z a-z
}
get_cpu
()
{
if
[[
"
$(
uname
-p
)
"
=
"i686"
]]
;
then
echo
"x86"
else
echo
"x64"
fi
}
os
=
$(
get_os
)
cpu
=
$(
get_cpu
)
platform
=
"
$os
-
$cpu
"
export
JQ
=
"
$BP_DIR
/vendor/jq-
$os
"
create_default_env
()
{
export
NPM_CONFIG_PRODUCTION
=
${
NPM_CONFIG_PRODUCTION
:-
true
}
export
NPM_CONFIG_LOGLEVEL
=
${
NPM_CONFIG_LOGLEVEL
:-
error
}
...
...
lib/json.sh
View file @
da19bdb7
get_os
()
{
uname
|
tr
A-Z a-z
}
get_cpu
()
{
if
[[
"
$(
uname
-p
)
"
=
"i686"
]]
;
then
echo
"x86"
else
echo
"x64"
fi
}
os
=
$(
get_os
)
cpu
=
$(
get_cpu
)
export
JQ
=
"
$BP_DIR
/vendor/jq-
$os
"
read_json
()
{
local
file
=
$1
local
key
=
$2
...
...
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