Skip to content

Commit

Permalink
disable recursive searching of .env file #24
Browse files Browse the repository at this point in the history
  • Loading branch information
hiro5id committed May 15, 2021
1 parent d48342c commit 6c87170
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/env/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@ export class Env {
}
}
}
return this.findOptionalEnvFile(path.resolve(startPath, '../'));
// Disable recursive searching for .env file due to issue: https://github.com/hiro5id/console-log-json/issues/24
// return this.findOptionalEnvFile(path.resolve(startPath, '../'));
return null;
}

public loadDotEnv() {
const optionalEnvFile = this.findOptionalEnvFile(__dirname);
const searchForEnvFileStartingInDirectory = process.cwd();
const optionalEnvFile = this.findOptionalEnvFile(searchForEnvFileStartingInDirectory);
if (optionalEnvFile != null && optionalEnvFile.length < 0) {
require('dotenv').config({ path: optionalEnvFile });
} else {
Expand Down

0 comments on commit 6c87170

Please sign in to comment.