diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cd92f28b6..9830c0c8a1 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 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 ## [15.0.8](https://github.com/expo/eas-cli/releases/tag/v15.0.8) - 2025-02-09 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..abd8f2306e 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(path.normalize(_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;