Passed
Push — master ( 46c280...b32c0f )
by Inumidun
36s
created

module.exports.getCurrentWorkingDir   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
rs 10
1
const fs = require('fs');
2
const path = require('path');
3
4
module.exports = {
5
  getCurrentDirectoryBase() {
6
    return path.basename(process.cwd());
7
  },
8
9
  getCurrentWorkingDir() {
10
    return process.cwd();
11
  },
12
13
  directoryExists(filePath) {
14
    try {
15
      return fs.statSync(filePath).isDirectory();
16
    } catch (err) {
17
      return false;
18
    }
19
  }
20
};
21