Skip to content

Commit

Permalink
Comments and fixes from PR.
Browse files Browse the repository at this point in the history
  • Loading branch information
edgonmsft committed Jun 27, 2022
1 parent 68e68b1 commit 39a1b22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/spec-configuration/containerFeaturesOrder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@ interface FeatureNode {

export function computeFeatureInstallationOrder(config: DevContainerConfig, features: FeatureSet[]) {

if (!config.overrideFeatureInstallOrder) {
return computeInstallationOrder(features);
if (config.overrideFeatureInstallOrder) {
return computeOverrideInstallationOrder(config, features);
}
else {
return computeOverrideInstallationOrder(config, features);
return computeInstallationOrder(features);
}
}

function computeOverrideInstallationOrder(config: DevContainerConfig, features: FeatureSet[]) {
// Starts with the automatic installation order.
const automaticOrder = computeInstallationOrder(features);

// Moves to the beginning the features that are explicitly configured.
const orderedFeatures = [];

for (const featureId of config.overrideFeatureInstallOrder!) {
const feature = automaticOrder.find(feature => feature.features[0].name === featureId);
if (!feature) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import { createPlainLog, LogLevel, makeLog } from '../../spec-utils/log';
import * as os from 'os';
import * as path from 'path';
import { mkdirpLocal } from '../../spec-utils/pfs';
import { DevContainerConfig } from '../../spec-configuration/configuration';
import { DevContainerConfig, DevContainerFeature } from '../../spec-configuration/configuration';
import { URI } from 'vscode-uri';
import { DevContainerFeature } from '../../spec-common/injectHeadless';

export const output = makeLog(createPlainLog(text => process.stdout.write(text), () => LogLevel.Trace));

Expand Down

0 comments on commit 39a1b22

Please sign in to comment.