Skip to content

Commit

Permalink
Fix build script
Browse files Browse the repository at this point in the history
  • Loading branch information
edizcelik committed Dec 17, 2021
1 parent 35f1d0c commit a8317b8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ try {

for (const file of files) {
try {
const folderFiles = await readdir(path.join(currentDirname, file));
if (lstatSync(file).isDirectory()) {
const folderFiles = await readdir(path.join(currentDirname, file));

if (folderFiles.some((folderFile) => folderFile.includes("icon.png"))) {
copyDirectorySync(file, buildDirectory);
if (folderFiles.some((folderFile) => folderFile.includes("icon.png"))) {
copyDirectorySync(file, buildDirectory);
}
}
} catch (error) {
console.error(error);
Expand Down Expand Up @@ -62,7 +64,7 @@ function createTargetDirectoryName(source) {

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

if (!existsSync(targetFolder)) {
Expand Down

0 comments on commit a8317b8

Please sign in to comment.