@@ -3,12 +3,12 @@ import * as tl from 'azure-pipelines-task-lib/task';
33import * as URL from 'url' ;
44import * as fs from 'fs' ;
55import * as constants from './constants' ;
6- import * as npmregistry from 'packaging-common/npm/npmregistry' ;
7- import * as util from 'packaging-common/util' ;
8- import * as npmutil from 'packaging-common/npm/npmutil' ;
6+ import * as npmregistry from 'azure-pipelines-tasks- packaging-common-v3 /npm/npmregistry' ;
7+ import * as util from 'azure-pipelines-tasks- packaging-common-v3 /util' ;
8+ import * as npmutil from 'azure-pipelines-tasks- packaging-common-v3 /npm/npmutil' ;
99import * as os from 'os' ;
10- import * as npmrcparser from 'packaging-common/npm/npmrcparser' ;
11- import * as pkgLocationUtils from 'packaging-common/locationUtilities' ;
10+ import * as npmrcparser from 'azure-pipelines-tasks- packaging-common-v3 /npm/npmrcparser' ;
11+ import * as pkgLocationUtils from 'azure-pipelines-tasks- packaging-common-v3 /locationUtilities' ;
1212
1313async function main ( ) : Promise < void > {
1414 tl . setResourcePath ( path . join ( __dirname , 'task.json' ) ) ;
@@ -26,13 +26,13 @@ async function main(): Promise<void> {
2626 }
2727
2828 if ( tl . getVariable ( "SAVE_NPMRC_PATH" ) ) {
29- saveNpmrcPath = tl . getVariable ( "SAVE_NPMRC_PATH" ) ;
29+ saveNpmrcPath = tl . getVariable ( "SAVE_NPMRC_PATH" ) ;
3030 }
3131 else {
3232 let tempPath = tl . getVariable ( 'Agent.BuildDirectory' ) || tl . getVariable ( 'Agent.TempDirectory' ) ;
3333 tempPath = path . join ( tempPath , 'npmAuthenticate' ) ;
3434 tl . mkdirP ( tempPath ) ;
35- saveNpmrcPath = fs . mkdtempSync ( tempPath + path . sep ) ;
35+ saveNpmrcPath = fs . mkdtempSync ( tempPath + path . sep ) ;
3636 tl . setVariable ( "SAVE_NPMRC_PATH" , saveNpmrcPath , false ) ;
3737 tl . setVariable ( "NPM_AUTHENTICATE_TEMP_DIRECTORY" , tempPath , false ) ;
3838 }
@@ -45,7 +45,7 @@ async function main(): Promise<void> {
4545
4646 if ( fs . existsSync ( indexFile ) ) { //If the file exists, add to it.
4747 npmrcTable = JSON . parse ( fs . readFileSync ( indexFile , 'utf8' ) ) ;
48-
48+
4949 }
5050 else { //If the file doesn't exist, create it.
5151 npmrcTable = new Object ( ) ;
@@ -85,7 +85,7 @@ async function main(): Promise<void> {
8585 for ( let serviceEndpoint of endpointRegistries ) {
8686
8787 if ( util . toNerfDart ( serviceEndpoint . url ) == util . toNerfDart ( RegistryURLString ) ) {
88- let serviceURL = URL . parse ( serviceEndpoint . url ) ;
88+ let serviceURL = URL . parse ( serviceEndpoint . url ) ;
8989 console . log ( tl . loc ( "AddingEndpointCredentials" , registryURL . host ) ) ;
9090 registry = serviceEndpoint ;
9191 npmrcFile = clearFileOfReferences ( npmrc , npmrcFile , serviceURL ) ;
@@ -110,13 +110,13 @@ async function main(): Promise<void> {
110110 npmrcFile . push ( os . EOL + registry . auth + os . EOL ) ;
111111 }
112112 else {
113- console . log ( tl . loc ( "IgnoringRegistry" , registryURL . host ) ) ;
113+ console . log ( tl . loc ( "IgnoringRegistry" , registryURL . host ) ) ;
114114 }
115115 }
116116}
117117
118118main ( ) . catch ( error => {
119- if ( tl . getVariable ( "NPM_AUTHENTICATE_TEMP_DIRECTORY" ) ) {
119+ if ( tl . getVariable ( "NPM_AUTHENTICATE_TEMP_DIRECTORY" ) ) {
120120 tl . rmRF ( tl . getVariable ( "NPM_AUTHENTICATE_TEMP_DIRECTORY" ) ) ;
121121 // Clear the variables after we rm-rf the main root directory
122122 tl . setVariable ( "SAVE_NPMRC_PATH" , "" , false ) ;
0 commit comments