Allow Unsupported platforms to run, when Environment variables are set. #200
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I develop on OpenBSD and one of the packages i have taken an interest in, uses surf for continuous integration, relying on dugite for git support.
When i initially looked at the problem i thought i could set
GIT_EXEC_PATH
andLOCAL_GIT_DIRECTORY
and things might work, but i hit somethrow new Error('Git not supported on platform: ' + process.platform)
errors.With these changes and when the environment variables are set, the
Git not supported on platform
are not hit and dugite uses my installed git package, with the environment variables not set there is no functionally change.I did the following changed.
Move platform check and Error into resolveEmbeddedGitDir, so if the
Environment variable 'LOCAL_GIT_DIRECTORY' is set, the error
throw new Error('Git not supported on platform: ' + process.platform)
is still executed.Change path.join to set git-core and git to be if win32 else 'others' (with others being Unixes)
I didn't want to just target OpenBSD as i know of other developments using FreeBSD will also be impacted.
I know OpenBSD (and FreeBSD) are not supported and don't expect support, but by having these changes unsupported platforms have a chance of running.
[Edit] I have tested this change on OpenBSD and Windows.