mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: add ui
This commit is contained in:
1 parent
558fe34db1
commit
2cbf05dfe3
12 files changed
+168
-204
No files matched your search
@@ -1,6 +1,9 @@
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import { Logger } from './logger';
|
||||
|
||||
const logger = new Logger('options');
|
||||
|
||||
export = function load() {
|
||||
let f = path.resolve(process.cwd(), 'config.json');
|
||||
@@ -13,7 +16,7 @@ export = function load() {
|
||||
try {
|
||||
result = JSON.parse(fs.readFileSync(f).toString());
|
||||
} catch (e) {
|
||||
console.error('Cannot read config file', e);
|
||||
logger.error('Cannot read config file %o', e);
|
||||
result = {};
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in new issue
Block a user