Skip to content

Commit

Permalink
feat(start-slicemachine): Remove logged in info when starting Slice M…
Browse files Browse the repository at this point in the history
…achine
  • Loading branch information
xrutayisire committed Oct 23, 2023
1 parent 1444d34 commit 0e263a3
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions packages/start-slicemachine/src/StartSliceMachineProcess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,25 +109,10 @@ export class StartSliceMachineProcess {
`Running at ${chalk.magenta(url)}`,
),
);
console.log(await this._buildLoggedInAsLine(chalk.dim("Loading...")));
console.log();

const profile = await this._fetchProfile();

// Non-TTY environments (like GitHub Actions) do not support line management.
process.stdout.moveCursor?.(0, -2);
process.stdout.clearLine?.(1);
console.log(
await this._buildLoggedInAsLine(
profile
? `${[profile.firstName, profile.lastName]
.filter(Boolean)
.join(" ")} ${chalk.dim(`(${profile.email})`)}`
: chalk.dim("Not logged in"),
),
);
console.log();

if (profile) {
this._sliceMachineManager.telemetry.identify({
userID: profile.shortId,
Expand Down Expand Up @@ -176,23 +161,6 @@ export class StartSliceMachineProcess {
)} ${chalk.dim("→")} ${value}`;
}

/**
* Returns a string with logged in Prismic user info formatted for the
* console.
*
* @param value - User info to display.
*
* @returns String to pass to the console.
*/
private async _buildLoggedInAsLine(value: string): Promise<string> {
const currentVersion =
await this._sliceMachineManager.versions.getRunningSliceMachineVersion();

return `${chalk.bgBlack(
` ${" ".repeat(currentVersion.length)}${chalk.bold("Logged in as")} `,
)} ${chalk.dim("→")} ${value}`;
}

/**
* Validates the project's config and content models.
*
Expand Down

0 comments on commit 0e263a3

Please sign in to comment.