If you execute any git commands (e.g. when calling remoteUrl()) but on a machine without git (e.g. docker) the output will return null as error, since this is what spawnSync returns as stderr. It is not very helpful:
Error: [git-rev-sync] failed to execute command: null
at _command (/app/node_modules/git-rev-sync/index.js:20:13)
at Object.remoteUrl (/app/node_modules/git-rev-sync/index.js:160:10)
at [...]
The error field on the other hand will contain something like "Error: spawnSync git ENOENT" which is also not the most user-friendly message but might point you in the right direction that git the executable is missing. ENOENT is unix lingo for "error no entry". This PR adds this error field so that the error message then looks like this:
Error: [git-rev-sync] failed to execute command: null/Error: spawnSync git ENOENT
at _command (/app/node_modules/git-rev-sync/index.js:20:13)
at Object.remoteUrl (/app/node_modules/git-rev-sync/index.js:160:10)
at [...]
I now know why the error occurs in my Docker image, but it might be helpful to others, too, to find a solution more quickly.
If you execute any git commands (e.g. when calling
remoteUrl()
) but on a machine without git (e.g. docker) the output will returnnull
as error, since this is whatspawnSync
returns as stderr. It is not very helpful:The
error
field on the other hand will contain something like "Error: spawnSync git ENOENT" which is also not the most user-friendly message but might point you in the right direction thatgit
the executable is missing.ENOENT
is unix lingo for "error no entry". This PR adds this error field so that the error message then looks like this:I now know why the error occurs in my Docker image, but it might be helpful to others, too, to find a solution more quickly.