style: update spacing between variables and if statements

This commit is contained in:
Allyedge
2022-05-11 18:02:34 +02:00
parent 6fd9eabfbb
commit 9121f48cc8

View File

@@ -16,15 +16,12 @@ export async function installDeps(choice, name) {
const pkg = await findUp('package.json', {
cwd: process.cwd() + '/' + name,
});
if (!pkg) throw new Error('No package.json found!');
const output = JSON.parse(await readFile(pkg, 'utf8'));
if (!output) throw new Error("Can't read file.");
const deps = output.dependencies;
if (!deps) throw new Error("Can't find dependencies.");
const spin = ora({
@@ -35,7 +32,6 @@ export async function installDeps(choice, name) {
const result = await execa(choice, ['install'], {
cwd: process.cwd() + '/' + name,
}).catch(() => null);
if (!result || result?.failed) {
spin.fail(`${redBright('Failed')} to install dependencies!`);
return process.exit(1);
@@ -66,12 +62,11 @@ export async function cloneRepo(lang, name) {
* @param {string} dest - The destination folder where the files will be copied to.
*/
function copyRecursiveSync(src, dest) {
var exists = fs.existsSync(src);
const exists = fs.existsSync(src);
var stats = exists && fs.statSync(src);
var isDirectory = exists && stats.isDirectory();
const stats = exists && fs.statSync(src);
const isDirectory = exists && stats.isDirectory();
if (isDirectory) {
fs.mkdirSync(dest);