This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
Respect the "NO_APM_DEDUPE" env var on Windows (for the postinstall script) #912
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.
Requirements
Description of the Change
Linux and macOS have respected a
NO_APM_DEDUPE
env var for a long time. When this env var is set, thepostinstall
script skips runningnpm dedupe
.This PR adds a few lines to the Windows-specific
script\postinstall.cmd
file to do the same thing on Windows.Alternate Designs
postinstall
script. (This would also be a good option).Benefits
This enables installing
apm
withnpm ci
in the Atom repository.Which in turn means we can have reliable, stable bootstrapping, when desired, for the Atom repo. No unexpected dependency changes, and no more hard-to-troubleshoot and hard-to-fix build failures.
(Note: Attempting to "disable deduping" may not work when installing
apm
as a git URL dependency. But installingapm
as a git URL depoendency has already been buggy for a long time, regardless of this PR. And this PR would not be a regression, just that the improvement here may not apply toapm
as a git URL dependency.)Possible Drawbacks
None.
Verification Process
For this repository on its own:
I ran
npm run postinstall
andnpm install
with this env var set (set NO_APM_DEDUPE=true
incmd.exe
).Deduping was successfully skipped, and a message was printed out (
>> Deduplication disabled
) to indicate that this is happening on purpose.For testing out installing
apm
in Atom withnpm ci
:cd atom\apm
NO_APM_DEDUPE=true
npm ci
apm
in-place to use the updatedscript\postinstall.cmd
.npm ci
, quickly afterapm
is extracted, copy the modifiedscript\postinstall.cmd
and paste to overwrite the existing, non-patched one inatom\apm\node_modules\atom-package-manager\script\postinstall.cmd
.apm
.)>> Deduplication disabled
npm ls
, and observe that no packages are reported missing.Applicable Issues
None.