1 | const path = require('path')
|
2 | const JoyCon = require('joycon').default
|
3 | const { SHERRY_CONFIG_FILE } = require('./env')
|
4 |
|
5 | const joycon = new JoyCon({
|
6 | files: [`${SHERRY_CONFIG_FILE}.js`, `${SHERRY_CONFIG_FILE}.json`]
|
7 | })
|
8 |
|
9 | module.exports = cwd =>
|
10 | joycon.load({
|
11 | cwd,
|
12 | stopDir: path.dirname(cwd)
|
13 | })
|
14 |
|
15 | module.exports.hasConfig = cwd => {
|
16 | return joycon.resolve({
|
17 | cwd,
|
18 | stopDir: path.dirname(cwd)
|
19 | })
|
20 | }
|