feat(medusa,medusa-cli): add an exec command (#7376)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2024-05-21 10:56:44 +02:00
1 parent 442b0b2038
commit 73c917fdce
5 files changed
+62 -1

No files matched your search

+13
View File
@@ -321,6 +321,19 @@ function buildLocalCommands(cli, isLocalProject) {
})
),
})
.command({
command: `exec [file] [args..]`,
desc: `Run a function defined in a file.`,
handler: handlerP(
getCommandHandler(`exec`, (args, cmd) => {
cmd(args)
// Return an empty promise to prevent handlerP from exiting early.
// The development server shouldn't ever exit until the user directly
// kills it so this is fine.
return new Promise((resolve) => {})
})
),
})
}
function isLocalMedusaProject() {