Skip to content

Commit 4bf760d

Browse files
fix: removed console.log statements
1 parent 9bbc025 commit 4bf760d

File tree

3 files changed

+68
-5
lines changed

3 files changed

+68
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $ npm install -g @contentstack/cli-cm-regex-validate
2121
$ csdx COMMAND
2222
running command...
2323
$ csdx (--version)
24-
@contentstack/cli-cm-regex-validate/1.1.4 darwin-arm64 node-v16.19.0
24+
@contentstack/cli-cm-regex-validate/1.1.4 darwin-arm64 node-v18.15.0
2525
$ csdx --help [COMMAND]
2626
USAGE
2727
$ csdx COMMAND

oclif.manifest.json

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"version": "1.1.4",
3+
"commands": {
4+
"cm:stacks:validate-regex": {
5+
"id": "cm:stacks:validate-regex",
6+
"description": "This command is used to find all the invalid regexes present in the content types and global fields of your stack.",
7+
"strict": true,
8+
"pluginName": "@contentstack/cli-cm-regex-validate",
9+
"pluginAlias": "@contentstack/cli-cm-regex-validate",
10+
"pluginType": "core",
11+
"aliases": [],
12+
"examples": [
13+
"$ csdx cm:stacks:validate-regex",
14+
"$ csdx cm:stacks:validate-regex -a <management_token_alias>",
15+
"$ csdx cm:stacks:validate-regex -c",
16+
"$ csdx cm:stacks:validate-regex -g",
17+
"$ csdx cm:stacks:validate-regex -f <path/to/the/directory>",
18+
"$ csdx cm:stacks:validate-regex -a <management_token_alias> -c -g",
19+
"$ csdx cm:stacks:validate-regex -a <management_token_alias> -c -g -f <path/to/the/directory>"
20+
],
21+
"flags": {
22+
"help": {
23+
"name": "help",
24+
"type": "boolean",
25+
"char": "h",
26+
"description": "To show the flags that can be used with this CLI command",
27+
"allowNo": false
28+
},
29+
"alias": {
30+
"name": "alias",
31+
"type": "option",
32+
"char": "a",
33+
"description": "Alias (name) assigned to the management token",
34+
"multiple": false
35+
},
36+
"contentType": {
37+
"name": "contentType",
38+
"type": "boolean",
39+
"char": "c",
40+
"description": "To find invalid regexes within the content types",
41+
"allowNo": false
42+
},
43+
"globalField": {
44+
"name": "globalField",
45+
"type": "boolean",
46+
"char": "g",
47+
"description": "To find invalid regexes within the global fields",
48+
"allowNo": false
49+
},
50+
"filePath": {
51+
"name": "filePath",
52+
"type": "option",
53+
"char": "f",
54+
"description": "[optional] The path or the location in your file system where the CSV output file should be stored.",
55+
"multiple": false
56+
}
57+
},
58+
"args": {}
59+
}
60+
}
61+
}

src/utils/generate-output.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as jsonexport from 'jsonexport'
22
import * as Table from 'cli-table3'
33
import * as path from 'path'
44
import * as fs from 'fs'
5+
import { cliux } from '@contentstack/cli-utilities'
56
const regexMessages = require('../../messages/index.json').validateRegex
67

78
export default async function generateOutput(flags: any, invalidRegex: any, tableData: any) {
@@ -28,10 +29,11 @@ export default async function generateOutput(flags: any, invalidRegex: any, tabl
2829
tableData.forEach((row: any) => {
2930
table.push(row)
3031
})
31-
console.log(table.toString())
32-
console.log(regexMessages.output.csvOutput, storagePath)
33-
console.log(regexMessages.output.docsLink)
32+
cliux.print(table.toString())
33+
cliux.print(regexMessages.output.csvOutput)
34+
cliux.print(storagePath)
35+
cliux.print(regexMessages.output.docsLink)
3436
} else {
35-
console.log(regexMessages.output.noInvalidRegex)
37+
cliux.print(regexMessages.output.noInvalidRegex)
3638
}
3739
}

0 commit comments

Comments
 (0)