Skip to content

Commit df37ed8

Browse files
committed
Initializing variables
1 parent 2b560af commit df37ed8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

backend/helpers.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ const path = require('path')
44

55
async function openFolderDialog(win) {
66
// https://stackoverflow.com/questions/46027287/electron-open-folder-dialog
7-
let dir = await dialog.showOpenDialog(win, { properties: [ 'openDirectory' ] })
7+
const dir = await dialog.showOpenDialog(win, { properties: [ 'openDirectory' ] })
88
return dir.filePaths[0] || null
99
}
1010

1111
function listFolder(folder) {
12-
files = fs.readdirSync(path.resolve(folder))
12+
let files = fs.readdirSync(path.resolve(folder))
1313
// Filter out directories
1414
files = files.filter(f => {
1515
let filePath = path.resolve(folder, f)
@@ -38,7 +38,7 @@ function ilistFolder(folder) {
3838

3939
function getAllFiles(dirPath, arrayOfFiles) {
4040
// https://coderrocketfuel.com/article/recursively-list-all-the-files-in-a-directory-using-node-js
41-
files = ilistFolder(dirPath)
41+
let files = ilistFolder(dirPath)
4242
arrayOfFiles = arrayOfFiles || []
4343
files.forEach(function(file) {
4444
const p = path.join(dirPath, file.path)

0 commit comments

Comments
 (0)