misc(v2): clean up comments in code (#2294)

This commit is contained in:
Yangshun Tay 2020-02-18 21:29:23 +08:00 committed by GitHub
parent d7f3dff6e6
commit 996b115199
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 234 additions and 155 deletions

View file

@ -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'))