Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/contentstack-export/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@
"main": "./lib/commands/cm/stacks/export.js",
"oclif": {
"commands": "./lib/commands",
"hooks": {
"init": ["./lib/hooks/init/load-chalk"]
},
"bin": "csdx",
"devPlugins": [
"@oclif/plugin-help"
Expand Down
9 changes: 9 additions & 0 deletions packages/contentstack-export/src/hooks/init/load-chalk.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { loadChalk } from "@contentstack/cli-utilities";

/**
* Ensures the cli-utilities chalk singleton is ready before commands run.
* Required when this CLI runs standalone (bin/run); when embedded under core csdx, core init also loads chalk.
*/
export default async function loadChalkHook(): Promise<void> {
await loadChalk();
}
3 changes: 3 additions & 0 deletions packages/contentstack-import/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@
"license": "MIT",
"oclif": {
"commands": "./lib/commands",
"hooks": {
"init": ["./lib/hooks/init/load-chalk"]
},
"bin": "csdx",
"repositoryPrefix": "<%- repo %>/blob/main/packages/contentstack-import/<%- commandPath %>"
},
Expand Down
9 changes: 9 additions & 0 deletions packages/contentstack-import/src/hooks/init/load-chalk.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { loadChalk } from '@contentstack/cli-utilities';

/**
* Ensures the cli-utilities chalk singleton is ready before commands run.
* Required when this CLI runs standalone (bin/run); when embedded under core csdx, core init also loads chalk.
*/
export default async function loadChalkHook(): Promise<void> {
await loadChalk();
}
Loading