MCPcopy
hub / github.com/sequelize/sequelize / rmDir

Function rmDir

build.js:21–37  ·  view source on GitHub ↗
(dirName)

Source from the content-addressed store, hash-verified

19const nodeMajorVersion = Number(process.version.match(/(?<=^v)\d+/));
20
21async function rmDir(dirName) {
22 try {
23 await stat(dirName);
24 if (nodeMajorVersion >= 14) {
25 const rm = promisify(fs.rm);
26 await rm(dirName, { recursive: true });
27 } else {
28 const rmdir = promisify(fs.rmdir);
29 if (nodeMajorVersion >= 12) {
30 await rmdir(dirName, { recursive: true });
31 } else {
32 await rmdir(dirName);
33 }}
34 } catch {
35 /* no-op */
36 }
37}
38
39async function main() {
40 console.log('Compiling sequelize...');

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected