File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -482,8 +482,9 @@ class Config {
482
482
if ( problem . action === 'delete' ) {
483
483
this . delete ( problem . key , problem . where )
484
484
} else if ( problem . action === 'rename' ) {
485
- const old = this . get ( problem . from , problem . where )
486
- this . set ( problem . to , old , problem . where )
485
+ const raw = this . data . get ( problem . where ) . raw ?. [ problem . from ]
486
+ const calculated = this . get ( problem . from , problem . where )
487
+ this . set ( problem . to , raw || calculated , problem . where )
487
488
this . delete ( problem . from , problem . where )
488
489
}
489
490
}
Original file line number Diff line number Diff line change @@ -25,6 +25,18 @@ exports[`test/index.js TAP credentials management def_auth > other registry 1`]
25
25
Object {}
26
26
`
27
27
28
+ exports [ `test/index.js TAP credentials management def_authEnv > default registry 1` ] = `
29
+ Object {
30
+ "auth": "\${PATH}",
31
+ "password": "",
32
+ "username": "<\\u0004�",
33
+ }
34
+ `
35
+
36
+ exports [ `test/index.js TAP credentials management def_authEnv > other registry 1` ] = `
37
+ Object {}
38
+ `
39
+
28
40
exports [ `test/index.js TAP credentials management def_passNoUser > default registry 1` ] = `
29
41
Object {
30
42
"email": "i@izs.me",
Original file line number Diff line number Diff line change @@ -701,6 +701,9 @@ email = i@izs.me
701
701
'.npmrc' : `_auth = ${ Buffer . from ( 'hello:world' ) . toString ( 'base64' ) }
702
702
always-auth = true` ,
703
703
} ,
704
+ def_authEnv : {
705
+ '.npmrc' : '_auth = ${PATH}' ,
706
+ } ,
704
707
none_authToken : { '.npmrc' : '_authToken = 0bad1de4' } ,
705
708
none_lcAuthToken : { '.npmrc' : '_authtoken = 0bad1de4' } ,
706
709
none_emptyConfig : { '.npmrc' : '' } ,
You can’t perform that action at this time.
0 commit comments