We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a38217d commit 3f17cbbCopy full SHA for 3f17cbb
options-loader/index.js
@@ -1,4 +1,5 @@
1
import { existsSync, readFileSync } from 'fs'
2
+import { join } from 'path'
3
import pico from 'picocolors'
4
5
export function loadOptions(spec, process, env) {
@@ -82,11 +83,14 @@ function parseValues(spec, args) {
82
83
}
84
85
function loadEnv(file) {
- if (!file || !existsSync(file)) return undefined
86
+ if (!file || !existsSync(file)) {
87
+ file = join(process.cwd(), '.env')
88
+ if (!existsSync(file)) return undefined
89
+ }
90
let result = {}
91
let lines
92
try {
- let lines = readFileSync(filePath, 'utf8').split('\n')
93
+ lines = readFileSync(file, 'utf8').split('\n')
94
} catch (error) {
95
return undefined
96
0 commit comments