From 40f5d3656808812d634b4d16b20ac015cc89f64b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Chmiela?= Date: Sun, 9 Feb 2025 12:59:19 +0100 Subject: [PATCH 1/4] Finally fix Windows not-ignoring files --- packages/eas-cli/src/vcs/clients/git.ts | 5 +---- packages/eas-cli/src/vcs/local.ts | 21 ++++++--------------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/packages/eas-cli/src/vcs/clients/git.ts b/packages/eas-cli/src/vcs/clients/git.ts index 6d22caf68c..b99b120ebf 100644 --- a/packages/eas-cli/src/vcs/clients/git.ts +++ b/packages/eas-cli/src/vcs/clients/git.ts @@ -329,10 +329,7 @@ export default class GitClient extends Client { const easIgnorePath = path.join(rootPath, EASIGNORE_FILENAME); if (await fs.exists(easIgnorePath)) { - const ignore = await Ignore.createAsync( - // eslint-disable-next-line no-underscore-dangle - process.env.__NORMALIZE === '1' ? path.normalize(rootPath) : rootPath - ); + const ignore = await Ignore.createAsync(rootPath); const wouldNotBeCopiedToClone = ignore.ignores(filePath); const wouldBeDeletedFromClone = ( diff --git a/packages/eas-cli/src/vcs/local.ts b/packages/eas-cli/src/vcs/local.ts index 737b90b3f6..f20e93e782 100644 --- a/packages/eas-cli/src/vcs/local.ts +++ b/packages/eas-cli/src/vcs/local.ts @@ -93,12 +93,11 @@ export class Ignore { } export async function makeShallowCopyAsync(_src: string, dst: string): Promise { - let src = _src; - - // eslint-disable-next-line no-underscore-dangle - if (process.env.__NORMALIZE === '1') { - src = path.toNamespacedPath(path.normalize(src)); - } + // `node:fs` on Windows adds a namespace prefix (e.g. `\\?\`) to the path provided + // to the `filter` function in `fs.cp`. We need to ensure that we compare the right paths + // (both with prefix), otherwise the `relativePath` ends up being wrong and causes no files + // to be ignored. + const src = path.toNamespacedPath(_src); Log.debug('makeShallowCopyAsync', { src, dst }); const ignore = await Ignore.createAsync(src); @@ -109,15 +108,7 @@ export async function makeShallowCopyAsync(_src: string, dst: string): Promise { - let srcFilePath = _srcFilePath; - - // eslint-disable-next-line no-underscore-dangle - if (process.env.__NORMALIZE === '1') { - // `node:fs` on Windows adds a namespace prefix (e.g. `\\?\`) to the path. - // We need to ensure that we compare the right paths (both with prefix), - // otherwise the `relativePath` ends up being wrong and causes no files to be ignored. - srcFilePath = path.toNamespacedPath(srcFilePath); - } + const srcFilePath = path.toNamespacedPath(_srcFilePath); if (srcFilePath === src) { return true; From 6cfc6822b71411a0ed0092a026ce1f7acb305dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Chmiela?= Date: Sun, 9 Feb 2025 13:01:06 +0100 Subject: [PATCH 2/4] Add changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cd92f28b6..b4e2696ac8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ This is the log of notable changes to EAS CLI and related packages. ### ๐Ÿ› Bug fixes +- Fix ignoring files in Git repositories on Windows when `requireCommit` is not enabled. ([#2894](https://github.com/expo/eas-cli/pull/2894) by [@sjchmiela](https://github.com/sjchmiela)) + ### ๐Ÿงน Chores ## [15.0.8](https://github.com/expo/eas-cli/releases/tag/v15.0.8) - 2025-02-09 From e83eacc7bc9c41d90ec1cfe908747811c7956b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Chmiela?= Date: Sun, 9 Feb 2025 13:02:23 +0100 Subject: [PATCH 3/4] Add normalize --- packages/eas-cli/src/vcs/local.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eas-cli/src/vcs/local.ts b/packages/eas-cli/src/vcs/local.ts index f20e93e782..abd8f2306e 100644 --- a/packages/eas-cli/src/vcs/local.ts +++ b/packages/eas-cli/src/vcs/local.ts @@ -97,7 +97,7 @@ export async function makeShallowCopyAsync(_src: string, dst: string): Promise Date: Sun, 9 Feb 2025 13:05:26 +0100 Subject: [PATCH 4/4] Fix changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4e2696ac8..9830c0c8a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ This is the log of notable changes to EAS CLI and related packages. ### ๐Ÿ› Bug fixes -- Fix ignoring files in Git repositories on Windows when `requireCommit` is not enabled. ([#2894](https://github.com/expo/eas-cli/pull/2894) by [@sjchmiela](https://github.com/sjchmiela)) +- Fix files not being ignored when creating a tarball on Windows in Git repository in no `requireCommit` mode. ([#2894](https://github.com/expo/eas-cli/pull/2894) by [@sjchmiela](https://github.com/sjchmiela)) ### ๐Ÿงน Chores