chore: peer dependency version (#8771)

* fix peer dependency version

* dotenv

* commands

* dotenv cli
This commit is contained in:
Carlos R. L. Rodrigues
2024-08-26 16:55:57 -03:00
committed by GitHub
parent afd25846f0
commit 3b4eea08ef
38 changed files with 230 additions and 228 deletions

View File

@@ -2,10 +2,9 @@ import { sync as existsSync } from "fs-exists-cached"
import { setTelemetryEnabled } from "medusa-telemetry"
import path from "path"
import { didYouMean } from "./did-you-mean"
import { toCamelCase } from "@medusajs/utils"
import resolveCwd from "resolve-cwd"
import { newStarter } from "./commands/new"
import { didYouMean } from "./did-you-mean"
import reporter from "./reporter"
const yargs = require(`yargs`)
@@ -40,9 +39,10 @@ function buildLocalCommands(cli, isLocalProject) {
}
try {
const { Commands } = require("@medusajs/medusa")
const cmdName = toCamelCase(command)
return Commands[cmdName]
const cmdPath = resolveCwd.silent(
`@medusajs/medusa/dist/commands/${command}`
)!
return require(cmdPath).default
} catch (err) {
if (!process.env.NODE_ENV?.startsWith("prod")) {
console.log("--------------- ERROR ---------------------")