mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-21 21:16:59 +02:00
misc(v2): clean up comments in code (#2294)
This commit is contained in:
parent
d7f3dff6e6
commit
996b115199
45 changed files with 234 additions and 155 deletions
|
@ -50,7 +50,7 @@ export async function init(
|
|||
|
||||
let name = siteName;
|
||||
|
||||
// Prompt if siteName is not passed from CLI
|
||||
// Prompt if siteName is not passed from CLI.
|
||||
if (!name) {
|
||||
const {name: promptedName} = await inquirer.prompt({
|
||||
type: 'input',
|
||||
|
@ -71,7 +71,7 @@ export async function init(
|
|||
}
|
||||
|
||||
let template = reqTemplate;
|
||||
// Prompt if template is not provided from CLI
|
||||
// Prompt if template is not provided from CLI.
|
||||
if (!template) {
|
||||
const {template: promptedTemplate} = await inquirer.prompt({
|
||||
type: 'list',
|
||||
|
@ -82,7 +82,7 @@ export async function init(
|
|||
template = promptedTemplate;
|
||||
}
|
||||
|
||||
// If user choose Git repository, we'll prompt for the url
|
||||
// If user choose Git repository, we'll prompt for the url.
|
||||
if (template === gitChoice) {
|
||||
const {gitRepoUrl} = await inquirer.prompt({
|
||||
type: 'input',
|
||||
|
@ -112,7 +112,7 @@ export async function init(
|
|||
throw new Error(chalk.red(`Cloning Git template: ${template} failed!`));
|
||||
}
|
||||
} else if (template && templates.includes(template)) {
|
||||
// Docusaurus templates
|
||||
// Docusaurus templates.
|
||||
try {
|
||||
await fs.copy(path.resolve(templatesDir, template), dest);
|
||||
} catch (err) {
|
||||
|
@ -125,7 +125,7 @@ export async function init(
|
|||
throw new Error('Invalid template');
|
||||
}
|
||||
|
||||
// Update package.json info
|
||||
// Update package.json info.
|
||||
try {
|
||||
await updatePkg(path.join(dest, 'package.json'), {
|
||||
name: kebabCase(name),
|
||||
|
@ -137,7 +137,7 @@ export async function init(
|
|||
throw err;
|
||||
}
|
||||
|
||||
// We need to Rename the gitignore file to .gitignore
|
||||
// We need to rename the gitignore file to .gitignore
|
||||
if (
|
||||
!fs.pathExistsSync(path.join(dest, '.gitignore')) &&
|
||||
fs.pathExistsSync(path.join(dest, 'gitignore'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue