mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
core: trim config
This commit is contained in:
1 parent
d30dc1e466
commit
1140f85654
2 files changed
+3
-3
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "2.37.4",
|
||||
"version": "2.37.5",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "src/loader",
|
||||
"module": "src/loader",
|
||||
|
||||
@@ -9,9 +9,9 @@ const logger = new Logger('options');
|
||||
export = function load() {
|
||||
const envFile = path.resolve(os.homedir(), '.hydro', 'env');
|
||||
if (fs.existsSync(envFile)) {
|
||||
const content = fs.readFileSync(envFile).toString();
|
||||
const content = fs.readFileSync(envFile).toString().replace(/\r/g, '');
|
||||
for (const line of content.split('\n')) {
|
||||
process.env[line.split('=')[0]] = line.split('=')[1];
|
||||
process.env[line.split('=')[0]] = line.split('=')[1].trim();
|
||||
}
|
||||
}
|
||||
const f = findFileSync('config.json', false);
|
||||
|
||||
Reference in new issue
Block a user