8000 `quiet` defaults to false - use `quiet: true` to suppress info log · motdotla/dotenv@b1d4a78 · GitHub
[go: up one dir, main page]

Skip to content

Commit b1d4a78

Browse files
committed
quiet defaults to false - use quiet: true to suppress info log
1 parent 6acdb0a commit b1d4a78

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

lib/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ function _resolveHome (envPath) {
190190

191191
function _configVault (options) {
192192
const debug = Boolean(options && options.debug)
193-
const quiet = options && 'quiet' in options ? options.quiet : true
193+
const quiet = Boolean(options && options.quiet)
194194

195195
if (debug || !quiet) {
196196
_log('Loading env from encrypted .env.vault')
@@ -212,7 +212,7 @@ function configDotenv (options) {
212212
const dotenvPath = path.resolve(process.cwd(), '.env')
213213
let encoding = 'utf8'
214214
const debug = Boolean(options && options.debug)
215-
const quiet = options && 'quiet' in options ? options.quiet : true
215+
const quiet = Boolean(options && options.quiet)
216216

217217
if (options && options.encoding) {
218218
encoding = options.encoding

tests/test-config-vault.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ t.test('logs when no path is set', ct => {
3434
ct.ok(logStub.called)
3535
})
3636

37-
t.test('does not log by default', ct => {
37+
t.test('does log by default', ct => {
3838
ct.plan(1)
3939

4040
logStub = sinon.stub(console, 'log')
4141

4242
dotenv.config({ path: testPath })
43-
ct.ok(logStub.notCalled)
43+
ct.ok(logStub.called)
4444
})
4545

4646
t.test('does not log if quiet flag passed true', ct => {
@@ -79,13 +79,13 @@ t.test('logs if debug set', ct => {
7979
ct.ok(logStub.called)
8080
})
8181

82-
t.test('does not log when testPath calls to .env.vault directly (interpret what the user meant)', ct => {
82+
t.test('does log when testPath calls to .env.vault directly (interpret what the user meant)', ct => {
8383
ct.plan(1)
8484

8585
logStub = sinon.stub(console, 'log')
8686

8787
dotenv.config({ path: `${testPath}.vault` })
88-
ct.ok(logStub.notCalled)
88+
ct.ok(logStub.called)
8989
})
9090

9191
t.test('logs when testPath calls to .env.vault directly (interpret what the user meant) and debug true', ct => {

tests/test-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ t.test('deals with file:// path', ct => {
261261
ct.equal(process.env.BASIC, undefined)
262262
ct.equal(env.error.message, "ENOENT: no such file or directory, open 'file:///tests/.env'")
263263

264-
ct.ok(logStub.notCalled)
264+
ct.ok(logStub.called)
265265

266266
logStub.restore()
267267

0 commit comments

Comments
 (0)
0