formatting
This commit is contained in:
@ -25,7 +25,7 @@ function run (folder, args) {
|
||||
const template = path.join (__dirname, 'template');
|
||||
if (!fs.existsSync (snip_folder))
|
||||
fs.mkdir (snip_folder);
|
||||
for (const f of fs.readdirSync (template))
|
||||
for (const f of fs.readdirSync (template)) {
|
||||
fs.copy (
|
||||
path.join (template, f),
|
||||
path.join (snip_folder, f),
|
||||
@ -34,6 +34,7 @@ function run (folder, args) {
|
||||
filter: (src, dest) => !fs.existsSync (dest)
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -75,11 +76,12 @@ function assert (folder, args) {
|
||||
reason: 'folder already exists'
|
||||
}
|
||||
];
|
||||
for (const test of tests)
|
||||
for (const test of tests) {
|
||||
if (!test.f ()) {
|
||||
console.log (test.reason);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ function run (folder, args) {
|
||||
const template = path.join (__dirname, 'template');
|
||||
if (!fs.existsSync (snip_folder))
|
||||
fs.mkdir (snip_folder);
|
||||
for (const f of fs.readdirSync (template))
|
||||
for (const f of fs.readdirSync (template)) {
|
||||
fs.copy (
|
||||
path.join (template, f),
|
||||
path.join (snip_folder, f),
|
||||
@ -34,6 +34,7 @@ function run (folder, args) {
|
||||
filter: (src, dest) => !fs.existsSync (dest)
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -75,11 +76,12 @@ function assert (folder, args) {
|
||||
reason: 'folder already exists'
|
||||
}
|
||||
];
|
||||
for (const test of tests)
|
||||
for (const test of tests) {
|
||||
if (!test.f ()) {
|
||||
console.log (test.reason);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user