File tree 1 file changed +3
-5
lines changed
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ function writeRegistryToFile(
29
29
scope = '@' + scope ;
30
30
}
31
31
if ( scope ) {
32
- scope = scope . toLowerCase ( ) ;
32
+ scope = scope . toLowerCase ( ) + ':' ;
33
33
}
34
34
35
35
core . debug ( `Setting auth in ${ fileLocation } ` ) ;
@@ -38,17 +38,15 @@ function writeRegistryToFile(
38
38
const curContents : string = fs . readFileSync ( fileLocation , 'utf8' ) ;
39
39
curContents . split ( os . EOL ) . forEach ( ( line : string ) => {
40
40
// Add current contents unless they are setting the registry
41
- if ( ! line . toLowerCase ( ) . startsWith ( ' registry' ) ) {
41
+ if ( ! line . toLowerCase ( ) . startsWith ( ` ${ scope } registry` ) ) {
42
42
newContents += line + os . EOL ;
43
43
}
44
44
} ) ;
45
45
}
46
46
// Remove http: or https: from front of registry.
47
47
const authString : string =
48
48
registryUrl . replace ( / ( ^ \w + : | ^ ) / , '' ) + ':_authToken=${NODE_AUTH_TOKEN}' ;
49
- const registryString : string = scope
50
- ? `${ scope } :registry=${ registryUrl } `
51
- : `registry=${ registryUrl } ` ;
49
+ const registryString : string = `${ scope } registry=${ registryUrl } ` ;
52
50
const alwaysAuthString : string = `always-auth=${ alwaysAuth } ` ;
53
51
newContents += `${ authString } ${ os . EOL } ${ registryString } ${ os . EOL } ${ alwaysAuthString } ` ;
54
52
fs . writeFileSync ( fileLocation , newContents ) ;
You can’t perform that action at this time.
0 commit comments