mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +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",
|
"name": "hydrooj",
|
||||||
"version": "2.37.4",
|
"version": "2.37.5",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ const logger = new Logger('options');
|
|||||||
export = function load() {
|
export = function load() {
|
||||||
const envFile = path.resolve(os.homedir(), '.hydro', 'env');
|
const envFile = path.resolve(os.homedir(), '.hydro', 'env');
|
||||||
if (fs.existsSync(envFile)) {
|
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')) {
|
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);
|
const f = findFileSync('config.json', false);
|
||||||
|
|||||||
Reference in new issue
Block a user