Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (appPkg.devDependencies && appPkg.devDependencies[dependName]) {
appPkg.devDependencies[dependName] = `^${pkg.data.version}`;
}
fs.writeFileSync(appPkgPath, JSON.stringify(appPkg, null, 2));
}
output.success(
`Dependent on ${output.cmd(dependName)} version has been set.`
);
}
await installDeps(projectPath, 'npm');
// eslint-disable-next-line
console.log(`š ${color.green('ā')} successfully installed ${color.cyan(projectName)} dependencies..`);
// eslint-disable-next-line
console.log(
'š Get started with the following commands:\n\n' +
`${projectPath === process.cwd() ? '' : color.cyan(` ${color.white('$')} cd ${projectName}\n`)}` +
` ${color.cyan(`${color.white('$')} npm run start\n\n`)}`
);
}).catch((err) => {
stopExampleSpinner();
if (appPkg.devDependencies && appPkg.devDependencies[dependName]) {
appPkg.devDependencies[dependName] = `^${pkg.data.version}`;
}
fs.writeFileSync(appPkgPath, JSON.stringify(appPkg, null, 2));
}
output.success(
`Dependent on ${output.cmd(dependName)} version has been set.`
);
}
await installDeps(projectPath, 'npm');
// eslint-disable-next-line
console.log(`š ${color.green('ā')} successfully installed ${color.cyan(projectName)} dependencies..`);
// eslint-disable-next-line
console.log(
'š Get started with the following commands:\n\n' +
`${projectPath === process.cwd() ? '' : color.cyan(` ${color.white('$')} cd ${projectName}\n`)}` +
` ${color.cyan(`${color.white('$')} npm run start\n\n`)}`
);
}).catch((err) => {
stopExampleSpinner();
}
stopSpinner();
// commit initial state
let gitCommitFailed = false;
if (tempDir) {
const copyTemp = await copyTemplate(tempDir, targetDir, { name, KKT_VERSION });
if (copyTemp && copyTemp.length > 0) {
copyTemp.sort().forEach((createdFile) => {
log(` ${'create'.green} ${createdFile.replace(targetDir, `${name}`)}`);
});
log('\nā Installing dependencies. This might take a while...\n');
await installDeps(targetDir, 'npm', cliOptions.registry);
log(`\nš ${'ā'.green} Successfully created project ${name.yellow}.`);
log(
'š Get started with the following commands:\n\n' +
`${targetDir === process.cwd() ? '' : chalk.cyan(` ${chalk.white('$')} cd ${name}\n`)}` +
` ${chalk.cyan(`${chalk.white('$')} npm run start\n\n`)}`
);
// ęäŗ¤ē¬¬äøꬔ记å½
if (shouldInitGit) {
await this.run('pwd');
await this.run('git add -A');
const msg = typeof cliOptions.git === 'string' ? cliOptions.git : 'Initial commit';
try {
await this.run('git', ['commit', '-m', msg]);
} catch (e) {
gitCommitFailed = true;
}
}
} else {
return log(` Copy Tamplate Error: ${copyTemp} !!!`.red);
}