mirror of
https://github.com/sern-handler/cli
synced 2026-06-06 01:16:53 +00:00
style: update spacing between variables and if statements
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user