Skip to content

Commit 916479a

Browse files
Apply suggestions from code review
Co-authored-by: James George <[email protected]>
1 parent cccb1dd commit 916479a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ docsify serve <path> [--open false] [--port 3000]
8989
- Default: `3000`
9090
- Description: Choose a listen port, defaults to `3000`.
9191

92-
### `gen` command
92+
### `generate` command
9393

9494
Docsify's generators.
9595

lib/commands/generate.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ module.exports = function (path = '', sidebar) {
1717

1818
if (!exists(sidebarPath)) {
1919
genSidebar(cwdPath, sidebarPath)
20-
console.log(chalk.green(`Generate sidebar file '${sidebar}' success.`))
20+
console.log(chalk.green(`Successfully generated the sidebar file '${sidebar}'.`))
2121
return true
2222
}
2323

24-
console.log(chalk.red(`${sidebarPath}`) + ' already exists.')
24+
console.error(chalk.red(`${sidebarPath}`) + ' already exists.')
2525
return false
2626
}
2727
}
2828

29-
console.log(chalk.red(`${cwdPath}`) + ' directory does not exist.')
29+
console.error(chalk.red(`${cwdPath}`) + ' directory does not exist.')
3030
}
3131

3232
function genSidebar(cwdPath, sidebarPath) {
@@ -61,7 +61,7 @@ function genSidebar(cwdPath, sidebarPath) {
6161
})
6262
fs.writeFile(sidebarPath, tree, 'utf8', err => {
6363
if (err) {
64-
console.log(chalk.red(`Generate sidebar file error, message: ${err.message}`))
64+
console.error(chalk.red(`Couldn't generate the sidebar file, error: ${err.message}`))
6565
}
6666
})
6767
}

0 commit comments

Comments
 (0)