Skip to content

Commit

Permalink
refactor(eas-cli): remove the cursor space when prompting dev domain …
Browse files Browse the repository at this point in the history
…after input (#2568)

* refactor(eas-cli): remove the cursor space when prompting dev domain after input

* docs(eas-cli): add changelog entry
  • Loading branch information
byCedric authored Sep 14, 2024
1 parent d7dfef0 commit 9c4ff98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ This is the log of notable changes to EAS CLI and related packages.
- Polish the project URL prompt when setting up new projects. ([#2564](https://github.com/expo/eas-cli/pull/2564) by [@byCedric](https://github.com/byCedric)))
- Always assume `static` exports in `eas deploy` and add modified time. ([#2565](https://github.com/expo/eas-cli/pull/2565) by [@byCedric](https://github.com/byCedric)))
- Update the `eas worker --help` `--environment` description. ([#2567](https://github.com/expo/eas-cli/pull/2567) by [@byCedric](https://github.com/byCedric)))
- Remove the cursor space after selecting project dev domain. ([#2568](https://github.com/expo/eas-cli/pull/2568) by [@byCedric](https://github.com/byCedric)))

## [12.3.0](https://github.com/expo/eas-cli/releases/tag/v12.3.0) - 2024-09-09

Expand Down
6 changes: 5 additions & 1 deletion packages/eas-cli/src/worker/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ type PromptInstance = {
placeholder: boolean;
rendered: string;
initial: string;
done: boolean;
get value(): string;
set value(input: string);
};
Expand Down Expand Up @@ -126,7 +127,10 @@ async function chooseDevDomainNameAsync({
onRender(this: PromptInstance, kleur) {
this.cursorOffset = -rootDomain.length - 1;

if (this.placeholder) {
if (this.done) {
// Remove the space for the cursor when the prompt is done
this.rendered = this.value + kleur.dim(`${rootDomain}`);
} else if (this.placeholder) {
this.rendered = kleur.dim(`${this.initial} ${rootDomain}`);
} else {
this.rendered = this.value + kleur.dim(` ${rootDomain}`);
Expand Down

0 comments on commit 9c4ff98

Please sign in to comment.