Skip to content

Commit

Permalink
fix line spacing for spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re committed Feb 2, 2023
1 parent a4907ed commit d24e9ee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/honest-crabs-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@astrojs/cli-kit": patch
---

Fix line spacing for spinner
5 changes: 3 additions & 2 deletions src/spinner/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import readline from 'node:readline';
import chalk from 'chalk';
import logUpdate from 'log-update';
import { createLogUpdate } from 'log-update';
import { erase, cursor } from 'sisteransi';
import { sleep } from '../utils/index.js'

Expand Down Expand Up @@ -49,6 +49,7 @@ function getGradientAnimFrames() {
* @returns Ora spinner for running .stop()
*/
async function gradient(text: string, { stdin = process.stdin, stdout = process.stdout } = {}) {
const logUpdate = createLogUpdate(stdout);
let i = 0;
const frames = getGradientAnimFrames();
let interval: NodeJS.Timeout;
Expand Down Expand Up @@ -104,5 +105,5 @@ export async function spinner({ start, end, while: update = () => sleep(100) }:
await act;
loading.stop();
};
stdout.write(`\n${' '.repeat(5)} ${chalk.green('✔')} ${chalk.green(end)}`)
stdout.write(`${' '.repeat(5)} ${chalk.green('✔')} ${chalk.green(end)}\n`)
}

0 comments on commit d24e9ee

Please sign in to comment.