Skip to content

Commit 906e98e

Browse files
committed
Update documentation and interactive input handling for release notes. Clarify that two blank lines are required to finish entering release notes instead of pressing Enter twice.
1 parent f03b016 commit 906e98e

2 files changed

Lines changed: 22 additions & 17 deletions

File tree

docs/testing-distribution/upload.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ appcircle testing-distribution upload [options]
2626
- Release notes are supported for both APK and AAB files
2727
- In interactive mode, you can enter multi-line release notes:
2828
- Type your release notes line by line
29-
- Press Enter twice to finish entering release notes
29+
- Leave two blank lines to finish entering release notes
3030
- You can include line breaks and formatting in your release notes
3131

3232
## Note on File Size Limits

src/core/interactive-runner.ts

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import * as readline from 'readline';
5050

5151
export const getSimpleMultilineInput = async (message: string): Promise<string> => {
5252
console.log(chalk.cyan('?'), message);
53-
console.log(chalk.gray('(Press Enter twice to finish)'));
53+
console.log(chalk.gray('(Leave two blank lines to finish)'));
5454

5555
return new Promise((resolve) => {
5656
const rl = readline.createInterface({
@@ -59,24 +59,29 @@ export const getSimpleMultilineInput = async (message: string): Promise<string>
5959
terminal: true
6060
});
6161

62-
let lines: string[] = [];
63-
let emptyLineCount = 0;
64-
65-
const onLine = (line: string) => {
66-
if (line.trim() === '') {
67-
emptyLineCount++;
68-
if (emptyLineCount >= 2) {
69-
// Two empty lines = finish
70-
rl.close();
71-
resolve(lines.join('\n').trim());
72-
return;
62+
let lines: string[] = [];
63+
let emptyLineCount = 0;
64+
65+
const onLine = (line: string) => {
66+
if (line.trim() === '') {
67+
emptyLineCount++;
68+
if (emptyLineCount >= 2) {
69+
// Two consecutive empty lines = finish
70+
// Remove the last empty line that was added
71+
if (lines.length > 0 && lines[lines.length - 1].trim() === '') {
72+
lines.pop();
7373
}
74-
} else {
75-
emptyLineCount = 0;
74+
rl.close();
75+
resolve(lines.join('\n').trim());
76+
return;
7677
}
77-
78+
// Add the empty line for single Enter press
79+
lines.push(line);
80+
} else {
81+
emptyLineCount = 0;
7882
lines.push(line);
79-
};
83+
}
84+
};
8085

8186
rl.on('line', onLine);
8287
rl.on('close', () => {

0 commit comments

Comments
 (0)