Skip to content

Commit

Permalink
chore: Use const instead of var
Browse files Browse the repository at this point in the history
  • Loading branch information
edizcelik committed Dec 17, 2021
1 parent d1835c0 commit 5b3044b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,14 @@ function createTargetDirectoryName(source) {

function copyDirectorySync(source, target) {
let targetDirName = createTargetDirectoryName(path.basename(source));
var files = [];

// Check if folder needs to be created or integrated
var targetFolder = path.join(target, targetDirName);
const files = [];
const targetFolder = path.join(target, targetDirName);

if (!existsSync(targetFolder)) {
console.log(`┏━━━ Creating ${targetFolder} ━━━━━━━━━━━━`);
mkdirSync(targetFolder);
}

// Copy source
if (lstatSync(source).isDirectory()) {
console.log(
`
Expand All @@ -81,7 +78,7 @@ function copyDirectorySync(source, target) {

files = readdirSync(source);
files.forEach(function (file) {
var curSource = path.join(source, file);
const curSource = path.join(source, file);

if (lstatSync(curSource).isDirectory()) {
copyDirectorySync(curSource, targetFolder);
Expand Down

0 comments on commit 5b3044b

Please sign in to comment.