Skip to content

Commit a6ac853

Browse files
committed
Write npm debug contents to log file
1 parent a281852 commit a6ac853

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/scripts/test_install

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ npm_install() {
217217
npm install "${pkg_name}@${pkg_version}" >> "${log_file}" 2>&1
218218
if [[ "$?" -ne 0 ]]; then
219219
echo "Encountered an error when installing ${pkg_name}@${pkg_version} via npm." >> "${log_file}" 2>&1
220+
cat "${working_dir}/npm-debug.log" >> "${log_file}" 2>&1
220221
return 1
221222
fi
222223
echo "Successfully installed ${pkg_name}@${pkg_version}." >> "${log_file}" 2>&1
@@ -245,6 +246,7 @@ npm_install_from_github() {
245246
npm install "${pkg_github_url}#${pkg_github_tag}" >> "${log_file}" 2>&1
246247
if [[ "$?" -ne 0 ]]; then
247248
echo "Encountered an error when installing ${pkg_github_url}#${pkg_github_tag} via npm." >> "${log_file}" 2>&1
249+
cat "${working_dir}/npm-debug.log" >> "${log_file}" 2>&1
248250
return 1
249251
fi
250252
echo "Successfully installed ${pkg_github_url}#${pkg_github_tag}." >> "${log_file}" 2>&1
@@ -268,6 +270,7 @@ npm_install_global() {
268270
npm install -g "${pkg_name}@${pkg_version}" >> "${log_file}" 2>&1
269271
if [[ "$?" -ne 0 ]]; then
270272
echo "Encountered an error when installing ${pkg_name}@${pkg_version} as a global package via npm." >> "${log_file}" 2>&1
273+
cat "${working_dir}/npm-debug.log" >> "${log_file}" 2>&1
271274
return 1
272275
fi
273276
npm list -g --depth=0 >> "${log_file}" 2>&1
@@ -306,6 +309,7 @@ npm_install_global_github() {
306309
npm install "${pkg_github_url}#${pkg_github_tag}" >> "${log_file}" 2>&1
307310
if [[ "$?" -ne 0 ]]; then
308311
echo "Encountered an error when installing ${pkg_github_url}#${pkg_github_tag} as a global package via npm." >> "${log_file}" 2>&1
312+
cat "${working_dir}/npm-debug.log" >> "${log_file}" 2>&1
309313
return 1
310314
fi
311315
npm list -g --depth=0 >> "${log_file}" 2>&1
@@ -350,7 +354,6 @@ test_npm_install() {
350354
npm_install
351355
if [[ "$?" -ne 0 ]]; then
352356
echo 'Installation failed.' >&2
353-
cat "${working_dir}/npm-debug.log" >&2
354357
return 1
355358
fi
356359
fi
@@ -366,7 +369,6 @@ test_npm_install() {
366369
npm_install_from_github
367370
if [[ "$?" -ne 0 ]]; then
368371
echo 'Installation (via GitHub) failed.' >&2
369-
cat "${working_dir}/npm-debug.log" >&2
370372
return 1
371373
fi
372374
fi
@@ -382,7 +384,6 @@ test_npm_install() {
382384
npm_install_global
383385
if [[ "$?" -ne 0 ]]; then
384386
echo 'Installation (global) failed.' >&2
385-
cat "${working_dir}/npm-debug.log" >&2
386387
return 1
387388
fi
388389
fi
@@ -398,7 +399,6 @@ test_npm_install() {
398399
npm_install_global_github
399400
if [[ "$?" -ne 0 ]]; then
400401
echo 'Installation (global via GitHub) failed.' >&2
401-
cat "${working_dir}/npm-debug.log" >&2
402402
return 1
403403
fi
404404
fi

0 commit comments

Comments
 (0)