From 67ed7d48f3862229c2d76933563ad7380f7272c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Chmiela?= Date: Fri, 15 Mar 2024 21:36:46 +0100 Subject: [PATCH 1/2] Log dirty files in non-interactive --- packages/eas-cli/src/build/configure.ts | 2 +- packages/eas-cli/src/build/utils/repository.ts | 13 ++++++++++++- packages/eas-cli/src/vcs/clients/git.ts | 5 +++++ packages/eas-cli/src/vcs/vcs.ts | 3 +++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/packages/eas-cli/src/build/configure.ts b/packages/eas-cli/src/build/configure.ts index 22414a393..10682ea82 100644 --- a/packages/eas-cli/src/build/configure.ts +++ b/packages/eas-cli/src/build/configure.ts @@ -40,7 +40,7 @@ async function configureAsync({ nonInteractive, vcsClient, }: ConfigureParams): Promise { - await maybeBailOnRepoStatusAsync(vcsClient); + await maybeBailOnRepoStatusAsync(vcsClient, nonInteractive); await createEasJsonAsync(projectDir, vcsClient); diff --git a/packages/eas-cli/src/build/utils/repository.ts b/packages/eas-cli/src/build/utils/repository.ts index 5c6874c4c..929e2bb27 100644 --- a/packages/eas-cli/src/build/utils/repository.ts +++ b/packages/eas-cli/src/build/utils/repository.ts @@ -12,7 +12,10 @@ import { getTmpDirectory } from '../../utils/paths'; import { endTimer, formatMilliseconds, startTimer } from '../../utils/timer'; import { Client } from '../../vcs/vcs'; -export async function maybeBailOnRepoStatusAsync(vcsClient: Client): Promise { +export async function maybeBailOnRepoStatusAsync( + vcsClient: Client, + nonInteractive: boolean +): Promise { if (!(await vcsClient.isCommitRequiredAsync())) { return; } @@ -28,6 +31,11 @@ export async function maybeBailOnRepoStatusAsync(vcsClient: Client): Promise { + const gitStatusOutput = await gitStatusAsync({ showUntracked: true }); + Log.log(gitStatusOutput); + } + public override async hasUncommittedChangesAsync(): Promise { const changes = await gitStatusAsync({ showUntracked: true }); return changes.length > 0; diff --git a/packages/eas-cli/src/vcs/vcs.ts b/packages/eas-cli/src/vcs/vcs.ts index 72101c805..189f777c7 100644 --- a/packages/eas-cli/src/vcs/vcs.ts +++ b/packages/eas-cli/src/vcs/vcs.ts @@ -51,6 +51,9 @@ export abstract class Client { // `commitAsync({ commitAllFiles: false })` public async showDiffAsync(): Promise {} + /** (optional) print list of changed files */ + public async showChangedFilesAsync(): Promise {} + // (optional) returns hash of the last commit // used for metadata - implementation can be safely skipped public async getCommitHashAsync(): Promise { From 047536f59d81ecbe4545c959b19c7f85750dfbe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Chmiela?= Date: Fri, 15 Mar 2024 20:43:51 +0000 Subject: [PATCH 2/2] update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d2540e4d..06fc24200 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ This is the log of notable changes to EAS CLI and related packages. ### 🎉 New features +- Print uncommitted files in non-interactive mode if they fail the execution. ([#2288](https://github.com/expo/eas-cli/pull/2288) by [@sjchmiela](https://github.com/sjchmiela)) + ### 🐛 Bug fixes - Fix expo-updates package version detection for canaries. ([#2243](https://github.com/expo/eas-cli/pull/2243) by [@wschurman](https://github.com/wschurman))