diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-09-17 23:42:30 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-09-17 23:42:30 +0800 |
commit | 8ed88ca8f81633d35b8a16b5e02588dde7f0f1e6 (patch) | |
tree | 5acf81464f4949d0b649b0cc715dba42a9183fc1 /CI/utils | |
parent | 878c3647c1625bfdeb9a5fddde18cd4a52dc1a68 (diff) | |
download | SoopyV2-8ed88ca8f81633d35b8a16b5e02588dde7f0f1e6.tar.gz SoopyV2-8ed88ca8f81633d35b8a16b5e02588dde7f0f1e6.tar.bz2 SoopyV2-8ed88ca8f81633d35b8a16b5e02588dde7f0f1e6.zip |
CI
Diffstat (limited to 'CI/utils')
-rw-r--r-- | CI/utils/walk.js | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/CI/utils/walk.js b/CI/utils/walk.js deleted file mode 100644 index 899128d..0000000 --- a/CI/utils/walk.js +++ /dev/null @@ -1,40 +0,0 @@ -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); - } - }); - }); - }); -}; - -async function walkP(dir) { //walk function but promisified - return new Promise((res, rej) => { - walk(dir, (err, resu) => { - if (err) { - rej(err) - return - } - - res(resu) - }); - }) -} - -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 |