You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by dp...@apache.org on 2018/08/22 17:10:36 UTC
[cordova-lib] 04/04: Fix false alarm for long first line in
HooksRunner.spec
This is an automated email from the ASF dual-hosted git repository.
dpogue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-lib.git
commit 47a3edc911a45beba6e8947c4742aa7720712f7a
Author: Raphael von der GrĂ¼n <ra...@gmail.com>
AuthorDate: Wed Aug 22 00:45:31 2018 +0200
Fix false alarm for long first line in HooksRunner.spec
Only warn about "too long shebang" if the file really starts with one
---
src/hooks/HooksRunner.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hooks/HooksRunner.js b/src/hooks/HooksRunner.js
index 0a0e686..ffd7da5 100644
--- a/src/hooks/HooksRunner.js
+++ b/src/hooks/HooksRunner.js
@@ -243,7 +243,7 @@ function extractSheBangInterpreter (fullpath) {
const fileChunk = fileData.toString();
const hookCmd = shebangCommand(fileChunk);
- if (fileData.length === chunkSize && !fileChunk.match(/[\r\n]/)) {
+ if (hookCmd && fileData.length === chunkSize && !fileChunk.match(/[\r\n]/)) {
events.emit('warn', 'shebang is too long for "' + fullpath + '"');
}
return hookCmd;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org