Files
medusa-store/packages/cli/create-medusa-app/src/utils/log-message.ts
Shahed Nasser 1e6d56bc18 feat(create-medusa-app): allow passing project name on command line (#10755)
Allow passing the project name on the command line:

```bash
npx create-medusa-app@latest my-project
```
2024-12-29 09:41:15 +00:00

28 lines
663 B
TypeScript

import chalk from "chalk"
import { program } from "commander"
import { logger } from "./logger.js"
type LogOptions = {
message: string
type?: "error" | "success" | "info" | "warn" | "verbose"
}
export default ({ message, type = "info" }: LogOptions) => {
switch (type) {
case "info":
logger.info(chalk.white(message))
break
case "success":
logger.info(chalk.green(message))
break
case "warn":
logger.warn(chalk.yellow(message))
break
case "verbose":
logger.info(`${chalk.bgYellowBright("VERBOSE LOG:")} ${message}`)
break
case "error":
program.error(chalk.bold.red(message))
}
}