Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve progress indicator for iOS builds without xcpretty #1254

Merged
Merged
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
9 changes: 7 additions & 2 deletions packages/platform-ios/src/commands/runIOS/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
getDefaultUserTerminal,
} from '@react-native-community/cli-tools';
import {Device} from '../../types';
import ora from 'ora';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolute import should be before relative ones I guess ;)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't care as long as linter is happy :)


type FlagsT = {
simulator?: string;
Expand Down Expand Up @@ -296,6 +297,7 @@ function buildProject(
'-destination',
`id=${udid}`,
];
const loader = ora();
logger.info(
`Building ${chalk.dim(
`(using "xcodebuild ${xcodebuildArgs.join(' ')}")`,
Expand Down Expand Up @@ -325,7 +327,9 @@ function buildProject(
if (logger.isVerbose()) {
logger.debug(stringData);
} else {
process.stdout.write('.');
loader.start(
`Building the app${'.'.repeat(buildOutput.length % 10)}`,
);
}
}
});
Expand All @@ -336,7 +340,7 @@ function buildProject(
if (xcpretty) {
xcpretty.stdin.end();
} else {
process.stdout.write('\n');
loader.stop();
}
if (code !== 0) {
reject(
Expand All @@ -353,6 +357,7 @@ function buildProject(
);
return;
}
logger.success('Successfully built the app');
resolve(getProductName(buildOutput) || scheme);
});
});
Expand Down