Skip to content

Commit

Permalink
fixup console log printing
Browse files Browse the repository at this point in the history
  • Loading branch information
pbohlman committed Jun 23, 2024
1 parent c87bdc0 commit 93b3a11
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/create-triplit-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'path';
import { fileURLToPath } from 'node:url';
import minimist from 'minimist';
import prompts, { override } from 'prompts';
import { yellow, blue, cyan, red, green } from 'ansis/colors';
import { yellow, blue, cyan, red, green, grey } from 'ansis/colors';
import degit from 'degit';
import { spawn } from 'child_process';
import { copy as fsExtraCopy, move } from 'fs-extra';
Expand Down Expand Up @@ -171,7 +171,6 @@ async function createTriplitAppWithVite() {
}

if (template) {
console.log('Loading template: ' + template);
const root = path.join(process.cwd(), targetDir);
createDirIfNotExists(root);
await loadTemplate(template, root);
Expand Down Expand Up @@ -287,7 +286,9 @@ async function loadTemplate(template: string, targetDir: string) {
throw new Error(
`Target directory ${targetDir} must be empty to load template`
);
console.log();
if (template === 'chat') {
console.log(grey`Creating project with chat template...`);
await degit('aspen-cloud/triplit/templates/chat-template').clone(targetDir);
console.log(`Created project with chat template at ${relativeTargetDir}`);
return;
Expand All @@ -300,10 +301,10 @@ async function loadTemplate(template: string, targetDir: string) {
overwrite: true,
});
console.log(
blue`Created project with ${template} template at ./${relativeTargetDir}`
grey`Created project with ${template} template at ./${relativeTargetDir}`
);
console.log();
console.log(green`To get started, run:`);
console.log(grey`To get started, run:`);
console.log();
console.log(cyan` cd ${relativeTargetDir}`);
console.log(cyan` npm install`);
Expand Down

0 comments on commit 93b3a11

Please sign in to comment.