Skip to content

Commit 0036a78

Browse files
author
alexlee-dev
committed
✏️ Success Message
1 parent 2b03e02 commit 0036a78

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
installDependencies,
88
installDevDependencies,
99
createTSConfig,
10+
displaySuccessMessage,
1011
} from "./init";
1112
import { handleIncorrectApplicationName } from "./program";
1213

@@ -47,6 +48,8 @@ const main = async (): Promise<void> => {
4748
await copyTemplateFiles(applicationName);
4849

4950
await createTSConfig(applicationName);
51+
52+
displaySuccessMessage(applicationName);
5053
};
5154

5255
export default main;

src/init.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,28 @@ export const createTSConfig = async (
151151
console.error(error);
152152
}
153153
};
154+
155+
export const displaySuccessMessage = (applicationName: string): void => {
156+
const root = path.resolve(applicationName);
157+
158+
console.log();
159+
console.log(
160+
`${chalk.greenBright("Success!")} Created ${chalk.yellowBright(
161+
applicationName
162+
)} at ${chalk.yellowBright(root)}`
163+
);
164+
console.log("Inside that directory, you can run several commands:");
165+
console.log();
166+
console.log(chalk.cyan(` npm run build`));
167+
console.log(" Creates a local build.");
168+
console.log();
169+
console.log(chalk.cyan(` npm start`));
170+
console.log(" Starts the application in the terminal.");
171+
console.log();
172+
console.log("We suggest that you begin by typing:");
173+
console.log();
174+
console.log(chalk.cyan(" cd"), root);
175+
console.log(` ${chalk.cyan(`npm run build && npm start`)}`);
176+
console.log();
177+
console.log(chalk.yellowBright("Happy CLI creating!"));
178+
};

0 commit comments

Comments
 (0)