-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract .gitignore from hosted tarball for prepare
Occasionally, a package installed from a hosted git repo requires its .gitignore in order to properly run its install/prepare process. Since we should treat git dependencies as being just like installing from an install cut from the actual git repo itself, it's inappropriate to munge the .gitignore into .npmignore at this step (even though it _is_ appropriate to do so in most other cases with remote tarballs). This adds the `allowGitIgnore` flag, which is then in turn used by the GitFetcher when it makes its call to RemoteFetcher to download and extract the hosted tarball for preparation. This was not an issue in npm v6, because prior to npm v7, hosted git snapshot tarballs were not used, so it never would go through the code path of using a 'remote' type fetcher to download the contents of a git repository (which was also much slower). Fixes: npm/cli#2144
- Loading branch information
Showing
8 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# just a file you can ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log('this is fine') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "prepare-requires-gitignore", | ||
"version": "1.2.3", | ||
"files": [ | ||
"index.js", | ||
"prepare_ran_successfully" | ||
], | ||
"scripts": { | ||
"prepare": "node prepare.js" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
const { statSync, writeFileSync } = require('fs') | ||
statSync(`${__dirname}/.gitignore`) | ||
writeFileSync(`${__dirname}/prepare_ran_successfully`, 'hello') | ||
console.log('this is fine') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters