Skip to content

Commit 9506913

Browse files
committed
fix: fix credential storage netrc warnings so they refer to the user's keychain
1 parent 71efb94 commit 9506913

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/credential-manager-core/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export async function saveAuth(account: string, token: string, hosts: string[],
3737
credDebug(message)
3838
if (process.env.HEROKU_KEYCHAIN_WARNINGS !== 'off') {
3939
ux.warn(heredoc(`
40-
We cant save the Heroku token to ${service}.
40+
We can't save the Heroku token to your computer's keychain.
4141
We'll save the token to the .netrc file instead.
4242
To turn off this warning, set HEROKU_KEYCHAIN_WARNINGS to "off".`))
4343
}
@@ -81,7 +81,7 @@ export async function getAuth(account: string | undefined, host: string, service
8181
credDebug(message)
8282
if (process.env.HEROKU_KEYCHAIN_WARNINGS !== 'off') {
8383
ux.warn(heredoc(`
84-
We cant retrieve the Heroku token from ${service}.
84+
We can't retrieve the Heroku token from your computer's keychain.
8585
We'll try to retrieve the token from the .netrc file instead.
8686
To turn off this warning, set HEROKU_KEYCHAIN_WARNINGS to "off".`))
8787
}
@@ -129,7 +129,7 @@ export async function removeAuth(account: string | undefined, hosts: string[], s
129129
credDebug(message)
130130
if (process.env.HEROKU_KEYCHAIN_WARNINGS !== 'off') {
131131
ux.warn(heredoc(`
132-
We cant remove the Heroku token from ${service}.
132+
We can't remove the Heroku token from your computer's keychain.
133133
We'll remove the token from the .netrc file instead.
134134
To turn off this warning, set HEROKU_KEYCHAIN_WARNINGS to "off".`))
135135
}

test/credential-manager/index.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ describe('credential-manager', function () {
9393

9494
expect(macosStub.calledOnce).to.be.true
9595
expect(netrcStub.calledOnce).to.be.true
96-
expect(unwrap(stderr.output)).to.contain('Warning: We cant save the Heroku token to heroku-cli.')
96+
expect(unwrap(stderr.output)).to.contain('Warning: We can\'t save the Heroku token to your computer\'s keychain.')
9797
expect(unwrap(stderr.output)).to.contain('We\'ll save the token to the .netrc file instead.')
9898
expect(unwrap(stderr.output)).to.contain('To turn off this warning, set HEROKU_KEYCHAIN_WARNINGS to "off".')
9999

@@ -200,7 +200,7 @@ describe('credential-manager', function () {
200200
expect(netrcStub.calledOnce).to.be.true
201201
expect(netrcStub.firstCall.args[0]).to.equal('api.heroku.com')
202202
expect(auth).to.deep.equal({account: 'user@example.com', token: 'netrc-token'})
203-
expect(unwrap(stderr.output)).to.contain('Warning: We cant retrieve the Heroku token from heroku-cli.')
203+
expect(unwrap(stderr.output)).to.contain('Warning: We can\'t retrieve the Heroku token from your computer\'s keychain.')
204204
expect(unwrap(stderr.output)).to.contain('We\'ll try to retrieve the token from the .netrc file instead.')
205205
expect(unwrap(stderr.output)).to.contain('To turn off this warning, set HEROKU_KEYCHAIN_WARNINGS to "off".')
206206

@@ -218,7 +218,7 @@ describe('credential-manager', function () {
218218
.to.be.rejectedWith(Error, 'No auth found for api.heroku.com')
219219
expect(macosStub.calledOnce).to.be.true
220220
expect(netrcStub.calledOnce).to.be.true
221-
expect(unwrap(stderr.output)).to.contain('Warning: We cant retrieve the Heroku token from heroku-cli.')
221+
expect(unwrap(stderr.output)).to.contain('Warning: We can\'t retrieve the Heroku token from your computer\'s keychain.')
222222
expect(unwrap(stderr.output)).to.contain('We\'ll try to retrieve the token from the .netrc file instead.')
223223
expect(unwrap(stderr.output)).to.contain('To turn off this warning, set HEROKU_KEYCHAIN_WARNINGS to "off".')
224224

@@ -236,7 +236,7 @@ describe('credential-manager', function () {
236236
.to.be.rejectedWith(Error, 'No auth found')
237237
expect(macosStub.calledOnce).to.be.true
238238
expect(netrcStub.calledOnce).to.be.true
239-
expect(unwrap(stderr.output)).to.contain('Warning: We cant retrieve the Heroku token from heroku-cli.')
239+
expect(unwrap(stderr.output)).to.contain('Warning: We can\'t retrieve the Heroku token from your computer\'s keychain.')
240240
expect(unwrap(stderr.output)).to.contain('We\'ll try to retrieve the token from the .netrc file instead.')
241241
expect(unwrap(stderr.output)).to.contain('To turn off this warning, set HEROKU_KEYCHAIN_WARNINGS to "off".')
242242

@@ -328,7 +328,7 @@ describe('credential-manager', function () {
328328

329329
expect(macosStub.calledOnce).to.be.true
330330
expect(netrcStub.calledOnce).to.be.true
331-
expect(unwrap(stderr.output)).to.contain('Warning: We cant remove the Heroku token from heroku-cli.')
331+
expect(unwrap(stderr.output)).to.contain('Warning: We can\'t remove the Heroku token from your computer\'s keychain.')
332332
expect(unwrap(stderr.output)).to.contain('We\'ll remove the token from the .netrc file instead.')
333333
expect(unwrap(stderr.output)).to.contain('To turn off this warning, set HEROKU_KEYCHAIN_WARNINGS to "off".')
334334

@@ -374,7 +374,7 @@ describe('credential-manager', function () {
374374

375375
expect(macosStub.notCalled).to.be.true
376376
expect(netrcStub.calledOnce).to.be.true
377-
expect(unwrap(stderr.output)).to.not.contain('We cant remove the Heroku token from heroku-cli.')
377+
expect(unwrap(stderr.output)).to.not.contain('We can\'t remove the Heroku token from your computer\'s keychain.')
378378

379379
stderr.stop()
380380
})

0 commit comments

Comments
 (0)