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
1bc7e183
Unverified
Commit
1bc7e183
authored
Feb 21, 2019
by
Jeremy Morrell
Committed by
GitHub
Feb 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix yarn run error when script is empty string (#624)
* Fix yarn run error when script is empty string
parent
9d563898
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
1 deletion
+33
-1
dependencies.sh
lib/dependencies.sh
+6
-1
README.md
test/fixtures/empty-heroku-postbuild-yarn/README.md
+1
-0
package.json
test/fixtures/empty-heroku-postbuild-yarn/package.json
+14
-0
yarn.lock
test/fixtures/empty-heroku-postbuild-yarn/yarn.lock
+4
-0
run
test/run
+8
-0
No files found.
lib/dependencies.sh
View file @
1bc7e183
...
@@ -21,13 +21,18 @@ run_if_present() {
...
@@ -21,13 +21,18 @@ run_if_present() {
local
build_dir
=
${
1
:-}
local
build_dir
=
${
1
:-}
local
script_name
=
${
2
:-}
local
script_name
=
${
2
:-}
local
has_script_name
local
has_script_name
local
script
has_script_name
=
$(
has_script
"
$build_dir
/package.json"
"
$script_name
"
)
has_script_name
=
$(
has_script
"
$build_dir
/package.json"
"
$script_name
"
)
script
=
$(
read_json
"
$build_dir
/package.json"
".scripts[
\"
$script_name
\"
]"
)
if
[[
"
$has_script_name
"
==
"true"
]]
;
then
if
[[
"
$has_script_name
"
==
"true"
]]
;
then
if
$YARN
;
then
if
$YARN
;
then
echo
"Running
$script_name
(yarn)"
echo
"Running
$script_name
(yarn)"
monitor
"
$script_name
"
yarn run
"
$script_name
"
# yarn will throw an error if the script is an empty string, so check for this case
if
[[
-n
"
$script
"
]]
;
then
monitor
"
$script_name
"
yarn run
"
$script_name
"
fi
else
else
echo
"Running
$script_name
"
echo
"Running
$script_name
"
monitor
"
$script_name
"
npm run
"
$script_name
"
--if-present
monitor
"
$script_name
"
npm run
"
$script_name
"
--if-present
...
...
test/fixtures/empty-heroku-postbuild-yarn/README.md
0 → 100644
View file @
1bc7e183
A fake README, to keep npm from polluting stderr.
\ No newline at end of file
test/fixtures/empty-heroku-postbuild-yarn/package.json
0 → 100644
View file @
1bc7e183
{
"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"
},
"scripts"
:
{
"build"
:
"echo build hook message"
,
"heroku-postbuild"
:
""
},
"heroku-run-build-script"
:
true
}
test/fixtures/empty-heroku-postbuild-yarn/yarn.lock
0 → 100644
View file @
1bc7e183
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
test/run
View file @
1bc7e183
...
@@ -87,6 +87,14 @@ testPreferEmptyHerokuPostbuildOverBuild() {
...
@@ -87,6 +87,14 @@ testPreferEmptyHerokuPostbuildOverBuild() {
assertCapturedSuccess
assertCapturedSuccess
}
}
testEmptyHerokuPostbuildWithYarn
()
{
compile
"empty-heroku-postbuild-yarn"
assertCaptured
"Running heroku-postbuild (yarn)"
assertNotCaptured
"build hook message"
assertNotCaptured
"Script must exist"
assertCapturedSuccess
}
testPrePostBuildScripts
()
{
testPrePostBuildScripts
()
{
compile
"pre-post-build-scripts"
compile
"pre-post-build-scripts"
assertCaptured
"Running heroku-prebuild"
assertCaptured
"Running heroku-prebuild"
...
...
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