Skip to content
Merged
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion packages/eas-cli/src/build/configure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async function configureAsync({
nonInteractive,
vcsClient,
}: ConfigureParams): Promise<void> {
await maybeBailOnRepoStatusAsync(vcsClient);
await maybeBailOnRepoStatusAsync(vcsClient, nonInteractive);

await createEasJsonAsync(projectDir, vcsClient);

Expand Down
13 changes: 12 additions & 1 deletion packages/eas-cli/src/build/utils/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
export async function maybeBailOnRepoStatusAsync(
vcsClient: Client,
nonInteractive: boolean
): Promise<void> {
if (!(await vcsClient.isCommitRequiredAsync())) {
return;
}
Expand All @@ -28,6 +31,11 @@ export async function maybeBailOnRepoStatusAsync(vcsClient: Client): Promise<voi
});

if (!answer) {
if (nonInteractive) {
Log.log('The following files need to be committed:');
await vcsClient.showChangedFilesAsync();
}

throw new Error('Commit all changes. Aborting...');
}
}
Expand All @@ -47,6 +55,9 @@ export async function ensureRepoIsCleanAsync(
)}.`
);
if (nonInteractive) {
Log.log('The following files need to be committed:');
await vcsClient.showChangedFilesAsync();

throw new Error('Commit all changes. Aborting...');
}
const answer = await confirmAsync({
Expand Down
5 changes: 5 additions & 0 deletions packages/eas-cli/src/vcs/clients/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ export default class GitClient extends Client {
return await this.hasUncommittedChangesAsync();
}

public override async showChangedFilesAsync(): Promise<void> {
const gitStatusOutput = await gitStatusAsync({ showUntracked: true });
Log.log(gitStatusOutput);
}

public override async hasUncommittedChangesAsync(): Promise<boolean> {
const changes = await gitStatusAsync({ showUntracked: true });
return changes.length > 0;
Expand Down
3 changes: 3 additions & 0 deletions packages/eas-cli/src/vcs/vcs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ export abstract class Client {
// `commitAsync({ commitAllFiles: false })`
public async showDiffAsync(): Promise<void> {}

/** (optional) print list of changed files */
public async showChangedFilesAsync(): Promise<void> {}

// (optional) returns hash of the last commit
// used for metadata - implementation can be safely skipped
public async getCommitHashAsync(): Promise<string | undefined> {
Expand Down