mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 01:38:19 +08:00
core: option: ignore empty line
This commit is contained in:
1 parent
a5838cb4cc
commit
4e6553033e
2 files changed
+2
-2
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "2.37.6",
|
||||
"version": "2.37.7",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "src/loader",
|
||||
"module": "src/loader",
|
||||
|
||||
@@ -10,7 +10,7 @@ export = function load() {
|
||||
const envFile = path.resolve(os.homedir(), '.hydro', 'env');
|
||||
if (fs.existsSync(envFile)) {
|
||||
const content = fs.readFileSync(envFile).toString().replace(/\r/g, '');
|
||||
for (const line of content.split('\n')) {
|
||||
for (const line of content.split('\n').filter((l) => l.trim())) {
|
||||
process.env[line.split('=')[0]] = line.split('=')[1].trim();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user