MCPcopy Create free account
hub / github.com/contentlayerdev/contentlayer / run

Function run

packages/@contentlayer/cli/src/index.ts:15–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13import { PostInstallCommand } from './commands/PostInstallCommand.js'
14
15export const run = async () => {
16 const [node, app, ...args] = process.argv
17
18 const contentlayerVersion = await pipe(
19 getContentlayerVersion(),
20 provideDummyTracing,
21 T.provideSomeLayer(NodeFsLive),
22 T.runPromise,
23 )
24
25 const cli = new Cli({
26 binaryLabel: `Contentlayer CLI`,
27 binaryName: process.env['CL_DEBUG'] ? `${node} ${app}` : 'contentlayer',
28 binaryVersion: contentlayerVersion,
29 })
30
31 cli.register(DefaultCommand)
32 cli.register(DevCommand)
33 cli.register(BuildCommand)
34 cli.register(PostInstallCommand)
35 cli.register(Builtins.HelpCommand)
36 cli.register(Builtins.VersionCommand)
37
38 // Run the CLI
39 await cli.runExit(args, Cli.defaultContext)
40}

Callers

nothing calls this directly

Calls 1

getContentlayerVersionFunction · 0.90

Tested by

no test coverage detected