diff --git a/CHANGELOG.md b/CHANGELOG.md index 791bf54946..2f006aebbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,10 +11,11 @@ This is the log of notable changes to EAS CLI and related packages. ### ๐Ÿ› Bug fixes - Fix bundle identifier resolution when native target is not provided. ([#434](https://github.com/expo/eas-cli/pull/434) by [@dsokal](https://github.com/dsokal)) +- Fix git repo root path getter on Windows. ([#429](https://github.com/expo/eas-cli/pull/429) by [@brentvatne](https://github.com/brentvatne)) ### ๐Ÿงน Chores -- Android credentials setup now on Graphql API ([#434](https://github.com/expo/eas-cli/pull/427) by [@quinlanj](https://github.com/quinlanj)) +- Android credentials setup now on Graphql API. ([#434](https://github.com/expo/eas-cli/pull/427) by [@quinlanj](https://github.com/quinlanj)) ## [0.16.0](https://github.com/expo/eas-cli/releases/tag/v0.16.0) - 2021-05-26 diff --git a/packages/eas-cli/src/build/utils/repository.ts b/packages/eas-cli/src/build/utils/repository.ts index 5d105e2790..7563cf17ae 100644 --- a/packages/eas-cli/src/build/utils/repository.ts +++ b/packages/eas-cli/src/build/utils/repository.ts @@ -123,7 +123,7 @@ async function makeProjectTarballAsync(): Promise<{ path: string; size: number } '--no-hardlinks', '--depth', '1', - `file://${await gitRootDirectoryAsync()}`, + await getGitRootFullPathAsync(), shallowClonePath, ]); await tar.create({ cwd: shallowClonePath, file: tarPath, prefix: 'project', gzip: true }, [ @@ -152,6 +152,18 @@ async function makeProjectTarballAsync(): Promise<{ path: string; size: number } return { size, path: tarPath }; } +async function getGitRootFullPathAsync() { + if (process.platform === 'win32') { + // getRootDirectoryAsync() will return C:/path/to/repo on Windows and path + // prefix should be file:/// + return `file:///${await gitRootDirectoryAsync()}`; + } else { + // getRootDirectoryAsync() will /path/to/repo, and path prefix should be + // file:/// so only file:// needs to be prepended + return `file://${await gitRootDirectoryAsync()}`; + } +} + async function showDiffAsync() { const outputTooLarge = (await getGitDiffOutputAsync()).split(/\r\n|\r|\n/).length > 100; await gitDiffAsync({ withPager: outputTooLarge });