Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/gitignore-dot-dirs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'eas-cli': patch
---

Read `.gitignore` files inside dot-directories when archiving the project.
14 changes: 14 additions & 0 deletions packages/eas-cli/src/vcs/__tests__/local-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ describe(Ignore, () => {
expect((ignore as any).ignoreMapping.map((i: any) => i[0])).toEqual(['', '', 'dir/']);
});

it('reads .gitignore from a dot-directory', async () => {
vol.fromJSON(
{
'.gitignore': 'aaa',
'.cache/.gitignore': 'bbb',
},
'/root'
);

const ignore = await Ignore.createForCopyingAsync('/root');
expect(ignore.ignores('bbb')).toBe(false);
expect(ignore.ignores('.cache/bbb')).toBe(true);
});

it('applies all gitignore files in parent directories', async () => {
vol.fromJSON(
{
Expand Down
3 changes: 2 additions & 1 deletion packages/eas-cli/src/vcs/local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ node_modules
const ignoreFilePaths = (
await fg(`**/${GITIGNORE_FILENAME}`, {
cwd: this.rootDir,
ignore: ['node_modules'],
ignore: ['node_modules', '.git'],
followSymbolicLinks: false,
dot: true,
})
)
// ensure that parent dir is before child directories
Expand Down
Loading