]>
Commit | Line | Data |
---|---|---|
4a6995be C |
1 | const path = require('path') |
2 | ||
3 | const ROOT = path.resolve(__dirname, '..') | |
4 | ||
5 | console.log('root directory:', root() + '\n') | |
6 | ||
7 | function hasProcessFlag (flag) { | |
8 | return process.argv.join('').indexOf(flag) > -1 | |
9 | } | |
10 | ||
11 | function root (args) { | |
12 | args = Array.prototype.slice.call(arguments, 0) | |
13 | return path.join.apply(path, [ROOT].concat(args)) | |
14 | } | |
15 | ||
16 | exports.hasProcessFlag = hasProcessFlag | |
17 | exports.root = root |