aboutsummaryrefslogtreecommitdiff
path: root/CI/utils
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-04-19 16:46:24 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-04-19 16:46:24 +0800
commitb0d6b24e7b916ff63e1de119eecf153eda45540f (patch)
tree1cd423e7e2851f552383c379be28cc16d6bd6d05 /CI/utils
parent70b9ee73274a099cba147e898cd67f26a3944243 (diff)
downloadSoopyV2-b0d6b24e7b916ff63e1de119eecf153eda45540f.tar.gz
SoopyV2-b0d6b24e7b916ff63e1de119eecf153eda45540f.tar.bz2
SoopyV2-b0d6b24e7b916ff63e1de119eecf153eda45540f.zip
+ Score calculations take into account spirit pet
+ Eman boss lazer phase timer
Diffstat (limited to 'CI/utils')
-rw-r--r--CI/utils/walk.js64
1 files changed, 32 insertions, 32 deletions
diff --git a/CI/utils/walk.js b/CI/utils/walk.js
index 4e99caa..899128d 100644
--- a/CI/utils/walk.js
+++ b/CI/utils/walk.js
@@ -1,40 +1,40 @@
var fs = require('fs');
var path = require('path');
-var walk = function(dir, done) {
- var results = [];
- fs.readdir(dir, function(err, list) {
- if (err) return done(err);
- var pending = list.length;
- if (!pending) return done(null, results);
- list.forEach(function(file) {
- file = path.resolve(dir, file);
- fs.stat(file, function(err, stat) {
- if (stat && stat.isDirectory()) {
- walk(file, function(err, res) {
- results = results.concat(res);
- if (!--pending) done(null, results);
- });
- } else {
- results.push(file);
- if (!--pending) done(null, results);
- }
- });
- });
- });
+var walk = function (dir, done) {
+ var results = [];
+ fs.readdir(dir, function (err, list) {
+ if (err) return done(err);
+ var pending = list.length;
+ if (!pending) return done(null, results);
+ list.forEach(function (file) {
+ file = path.resolve(dir, file);
+ fs.stat(file, function (err, stat) {
+ if (stat && stat.isDirectory()) {
+ walk(file, function (err, res) {
+ results = results.concat(res);
+ if (!--pending) done(null, results);
+ });
+ } else {
+ results.push(file);
+ if (!--pending) done(null, results);
+ }
+ });
+ });
+ });
};
-async function walkP(dir){ //walk function but promisified
- return new Promise((res, rej)=>{
- walk(dir, (err, resu)=>{
- if(err){
- rej(err)
- return
- }
+async function walkP(dir) { //walk function but promisified
+ return new Promise((res, rej) => {
+ walk(dir, (err, resu) => {
+ if (err) {
+ rej(err)
+ return
+ }
- res(resu)
- });
- })
+ res(resu)
+ });
+ })
}
-module.exports = {walk, walkP} //https://stackoverflow.com/questions/5827612/node-js-fs-readdir-recursive-directory-search
+module.exports = { walk, walkP } //https://stackoverflow.com/questions/5827612/node-js-fs-readdir-recursive-directory-search
//i was just too lazy to code this myself OMEGALUL \ No newline at end of file