mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-17 17:23:41 +02:00
feat: use node.js module instead of
This commit is contained in:
parent
fd09d9c960
commit
8eaa9f285c
2 changed files with 29 additions and 39 deletions
|
@ -1,3 +1,6 @@
|
|||
var { readdirSync, lstatSync } = require('fs');
|
||||
var { join } = require('path');
|
||||
|
||||
var escapeString = require('../util/escapeString');
|
||||
var constants = require('../util/constants');
|
||||
|
||||
|
@ -56,3 +59,16 @@ exports.genParseCommand = function(regexMap, eventName) {
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
exports.readDirDeep = function(dir) {
|
||||
var paths = [];
|
||||
readdirSync(dir).forEach(function(path) {
|
||||
var aPath = join(dir, path);
|
||||
if (lstatSync(aPath).isDirectory()) {
|
||||
paths.push(...exports.readDirDeep(aPath));
|
||||
} else {
|
||||
paths.push(aPath);
|
||||
}
|
||||
});
|
||||
return paths;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue