Skip to content
Snippets Groups Projects
Commit 11d5652a authored by Jake Read's avatar Jake Read
Browse files

win -> linux

parent 0059337b
Branches
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@ module.exports = {
// get a tree: takes the root (relative the process) and returns all branches below,
// includes route-to-root in list
getDirTree: (dir, debug) => {
debug = true
let tld = dir
return new Promise((resolve, reject) => {
// items and count,
......@@ -13,7 +14,7 @@ module.exports = {
let count = 0
// recursor,
let launch = (dir) => {
if(true) console.log('GDT launch at', dir)
if(debug) console.log('GDT launch at', dir)
// just counting actually,
count ++
fs.readdir(dir, (err, files) => {
......@@ -23,10 +24,13 @@ module.exports = {
count --
for (file of files) {
if (file.includes('.')) {
if(debug) console.log('GDT pushing', `${dir}${file}`)
list.push(`${dir.substring(__dirname.length + tld.length)}/${file}`)
let listAddition = `${dir.substring(__dirname.length + tld.length)}/${file}`
if(debug) console.log('GDT pushing', listAddition)
list.push(listAddition)
} else {
launch(`${dir}${file}`)
let launchPoint = `${dir}${file}`
if(debug) console.log('GDT launching', launchPoint)
launch(launchPoint)
}
}
if(debug) console.log('GDT size', count)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment