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

Change text on succeed() #144

Closed
sebastiantf opened this issue Apr 13, 2020 · 2 comments
Closed

Change text on succeed() #144

sebastiantf opened this issue Apr 13, 2020 · 2 comments

Comments

@sebastiantf
Copy link

sebastiantf commented Apr 13, 2020

Is there any way to change the text when we call .succeed() so that when the spinner succeeds and green tick mark is shown, the text is changed to a success message.

Right now, I'm using stopAndPersist() as below:

    const spinner = ora(`Doing something...`).start();

    // Do something async...
    await doSomething();

    spinner.stopAndPersist({
        symbol: colors.green("✔"),
        text: "Successfully backed up .git",
    });

Is this the only way to achieve what I want, or am I missing something?

If this is the only way, it would be nice to have this functionality (to change the text on success) built into succeed()

@sindresorhus
Copy link
Owner

.succeed() accepts a text argument.

@sebastiantf
Copy link
Author

sebastiantf commented Apr 14, 2020

Yes I used that too but it didn't seem to change the text at the time I opened this issue. I think it must've been because I wasn't doing an async operation at that time.

It seems to work fine now.

Closing this then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants