@@ -25,15 +25,23 @@ export class MsdoInstaller {
2525 }
2626
2727 // initialize the _msdo directory
28- let msdoDirectory = path . join ( process . env . AGENT_ROOTDIRECTORY , '_msdo' ) ;
29- tl . debug ( `msdoDirectory = ${ msdoDirectory } ` ) ;
30- this . ensureDirectory ( msdoDirectory ) ;
28+ let agentDirectory = path . join ( process . env . AGENT_ROOTDIRECTORY , '_msdo' ) ;
29+ tl . debug ( `agentDirectory = ${ agentDirectory } ` ) ;
30+ this . ensureDirectory ( agentDirectory ) ;
31+
32+ let agentPackagesDirectory = process . env . MSDO_PACKAGES_DIRECTORY ;
33+ if ( ! agentPackagesDirectory ) {
34+ agentPackagesDirectory = path . join ( agentDirectory , 'packages' ) ;
35+ tl . debug ( `agentPackagesDirectory = ${ agentPackagesDirectory } ` ) ;
36+ this . ensureDirectory ( agentPackagesDirectory ) ;
37+ process . env . MSDO_PACKAGES_DIRECTORY = agentPackagesDirectory ;
38+ }
3139
32- let msdoPackagesDirectory = path . join ( msdoDirectory , 'versions' ) ;
33- tl . debug ( `msdoPackagesDirectory = ${ msdoPackagesDirectory } ` ) ;
34- this . ensureDirectory ( msdoPackagesDirectory ) ;
40+ let agentVersionsDirectory = path . join ( agentDirectory , 'versions' ) ;
41+ tl . debug ( `agentVersionsDirectory = ${ agentVersionsDirectory } ` ) ;
42+ this . ensureDirectory ( agentVersionsDirectory ) ;
3543
36- let msdoVersionsDirectory = path . join ( msdoPackagesDirectory , 'microsoft.security.devops.cli' ) ;
44+ let msdoVersionsDirectory = path . join ( agentVersionsDirectory , 'microsoft.security.devops.cli' ) ;
3745 tl . debug ( `msdoVersionsDirectory = ${ msdoVersionsDirectory } ` ) ;
3846
3947 if ( this . isInstalled ( msdoVersionsDirectory , cliVersion ) ) {
@@ -59,7 +67,7 @@ export class MsdoInstaller {
5967 . arg ( msdoProjectFile )
6068 . arg ( `/p:MsdoPackageVersion=${ cliVersion } ` )
6169 . arg ( '--packages' )
62- . arg ( msdoPackagesDirectory )
70+ . arg ( agentVersionsDirectory )
6371 . arg ( '--source' )
6472 . arg ( 'https://api.nuget.org/v3/index.json' ) ;
6573
0 commit comments