From aeac56c95df13b5f08fdb42c521844c5208056dd Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sun, 12 Nov 2023 23:02:07 +0200 Subject: [PATCH] Reformat assets.js code --- src/assets.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/assets.js b/src/assets.js index 0087d3a62..a489c5dfb 100644 --- a/src/assets.js +++ b/src/assets.js @@ -40,20 +40,20 @@ function checkAssetFileName(inputFilename) { // Recursive function to get files function getFiles(dir, files = []) { // Get an array of all files and directories in the passed directory using fs.readdirSync - const fileList = fs.readdirSync(dir) + const fileList = fs.readdirSync(dir); // Create the full path of the file/directory by concatenating the passed directory and file/directory name for (const file of fileList) { - const name = `${dir}/${file}` + const name = `${dir}/${file}`; // Check if the current file/directory is a directory using fs.statSync if (fs.statSync(name).isDirectory()) { - // If it is a directory, recursively call the getFiles function with the directory path and the files array - getFiles(name, files) + // If it is a directory, recursively call the getFiles function with the directory path and the files array + getFiles(name, files); } else { - // If it is a file, push the full path to the files array - files.push(name) + // If it is a file, push the full path to the files array + files.push(name); } } - return files + return files; } /** @@ -90,10 +90,10 @@ function registerEndpoints(app, jsonParser) { if (folder == "live2d") { output[folder] = []; const live2d_folder = path.normalize(path.join(folderPath, folder)); - const files = getFiles(live2d_folder) + const files = getFiles(live2d_folder); //console.debug("FILE FOUND:",files) for (let file of files) { - file = path.normalize(file.replace('public'+path.sep, '')); + file = path.normalize(file.replace('public' + path.sep, '')); if (file.endsWith("model3.json")) { //console.debug("Asset live2d model found:",file) output[folder].push(path.normalize(path.join(file)));