@@ -368,7 +368,7 @@ function updateFromOldProperties<T extends { features: (Feature & { extensions?:
368368
369369// Generate a base featuresConfig object with the set of locally-cached features,
370370// as well as downloading and merging in remote feature definitions.
371- export async function generateFeaturesConfig ( params : { extensionPath : string ; cwd : string ; output : Log ; env : NodeJS . ProcessEnv } , dstFolder : string , config : DevContainerConfig , getLocalFolder : ( d : string ) => string ) {
371+ export async function generateFeaturesConfig ( params : { extensionPath : string ; cwd : string ; output : Log ; env : NodeJS . ProcessEnv } , dstFolder : string , config : DevContainerConfig , getLocalFeaturesFolder : ( d : string ) => string ) {
372372 const { output } = params ;
373373
374374 const userFeatures = featuresToArray ( config ) ;
@@ -385,7 +385,8 @@ export async function generateFeaturesConfig(params: { extensionPath: string; cw
385385
386386 // load local cache of features;
387387 // TODO: Update so that cached features are always version 2
388- let locallyCachedFeatureSet = await loadFeaturesJsonFromDisk ( getLocalFolder ( params . extensionPath ) , output ) ; // TODO: Pass dist folder instead to also work with the devcontainer.json support package.
388+ const localFeaturesFolder = getLocalFeaturesFolder ( params . extensionPath ) ;
389+ const locallyCachedFeatureSet = await loadFeaturesJsonFromDisk ( localFeaturesFolder , output ) ; // TODO: Pass dist folder instead to also work with the devcontainer.json support package.
389390 if ( ! locallyCachedFeatureSet ) {
390391 output . write ( 'Failed to load locally cached features' , LogLevel . Error ) ;
391392 return undefined ;
@@ -397,7 +398,7 @@ export async function generateFeaturesConfig(params: { extensionPath: string; cw
397398
398399 // Fetch features and get version information
399400 output . write ( '--- Fetching User Features ----' , LogLevel . Trace ) ;
400- await fetchFeatures ( params , featuresConfig , locallyCachedFeatureSet , dstFolder ) ;
401+ await fetchFeatures ( params , featuresConfig , locallyCachedFeatureSet , dstFolder , localFeaturesFolder ) ;
401402
402403 const ordererdFeatures = computeFeatureInstallationOrder ( config , featuresConfig . featureSets ) ;
403404
@@ -625,7 +626,7 @@ export function parseFeatureIdentifier(output: Log, userFeature: DevContainerFea
625626 }
626627}
627628
628- async function fetchFeatures ( params : { extensionPath : string ; cwd : string ; output : Log ; env : NodeJS . ProcessEnv } , featuresConfig : FeaturesConfig , localFeatures : FeatureSet , dstFolder : string ) {
629+ async function fetchFeatures ( params : { extensionPath : string ; cwd : string ; output : Log ; env : NodeJS . ProcessEnv } , featuresConfig : FeaturesConfig , localFeatures : FeatureSet , dstFolder : string , localFeaturesFolder : string ) {
629630 for ( const featureSet of featuresConfig . featureSets ) {
630631 try {
631632 if ( ! featureSet || ! featureSet . features || ! featureSet . sourceInformation )
@@ -652,7 +653,7 @@ async function fetchFeatures(params: { extensionPath: string; cwd: string; outpu
652653 if ( sourceInfoType === 'local-cache' ) {
653654 // create copy of the local features to set the environment variables for them.
654655 await mkdirpLocal ( featCachePath ) ;
655- await cpDirectoryLocal ( path . join ( dstFolder , 'local-cache' ) , featCachePath ) ;
656+ await cpDirectoryLocal ( localFeaturesFolder , featCachePath ) ;
656657
657658 await parseDevContainerFeature ( featureSet , feature , featCachePath ) ;
658659
0 commit comments