diff --git a/index.js b/index.js index 1b2f96d..e5a762f 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,6 @@ //Modules const AdmZip = require('adm-zip'); -const { emptyDirSync } = require('fs-extra'); +const { emptyDirSync, ensureDirSync } = require('fs-extra'); const path = require('path'); const pcbStackup = require('pcb-stackup'); const sharp = require('sharp'); @@ -10,19 +10,9 @@ const { existsSync, accessSync, createReadStream, - mkdirSync, - chmodSync, constants, } = require('node:fs'); -//ensureDirSync method -function ensureDirSync(directory) { - if (!existsSync(directory)) { - mkdirSync(directory, { recursive: true }); - chmodSync(directory, 0o644); - } -} - //Class definition class ImageGenerator { constructor(folderConfig, imgConfig, layerNames) {