Skip to content

Commit

Permalink
Invert installDependencies to skipExtensionDependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinGrote committed Feb 2, 2024
1 parent 108c71d commit 68c968f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
17 changes: 8 additions & 9 deletions src/bin.mts
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,16 @@ const args = yargs(process.argv)
group: vscodeSection,
})
.option('install-extensions', {
alias: 'e',
type: 'array',
description:
"A list of vscode extensions to install prior to running the tests. Can be specified as 'owner.extension','[email protected]', 'owner.extension@prerelease', or the path to a vsix file (/path/to/extension.vsix)",
group: vscodeSection,
})
.option('install-extension-dependencies', {
alias: 'd',
type: 'array',
.option('skip-extension-dependencies', {
type: 'boolean',
default: false,
description:
'If specified, will install all extensions listed in the extensionDependencies key of the package.json located at ExtensionDevelopmentPath. Extension specifications (such as specifying a prerelease or pinned version) defined in extensions will override entries found via this setting.',
'By default, vscode-cli will install all extensions listed in the extensionDependencies key of the package.json located at ExtensionDevelopmentPath. --install-extensions will override any extensions found in this manner. This setting disables this autodiscovery behavior.',
group: vscodeSection,
})
//#region Rules & Behavior
Expand Down Expand Up @@ -396,14 +395,14 @@ async function runConfigs(configs: readonly IConfigWithPath[]) {
const desktopPlatform = config.desktopPlatform;
const extensionDevelopmentPath = config.extensionDevelopmentPath?.slice() || dirname(path);
const extensionsToInstall = args.installExtensions?.map(String) || config.installExtensions;
const installDependentExtensions =
!!args.installExtensionDependencies || config.installExtensionDependencies;
const skipExtensionDependencies =
!!args.skipExtensionDependencies || config.skipExtensionDependencies;

if (extensionsToInstall || installDependentExtensions) {
if (extensionsToInstall || skipExtensionDependencies) {
const installResult = await installExtensions(
extensionDevelopmentPath,
extensionsToInstall,
installDependentExtensions,
skipExtensionDependencies,
codeVersion,
desktopPlatform,
reporter,
Expand Down
4 changes: 2 additions & 2 deletions src/config.cts
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ export interface IDesktopTestConfiguration extends IBaseTestConfiguration {
/** A list of vscode extensions to install prior to running the tests. Can be specified as 'owner.extension','owner.extension\@2.3.15', 'owner.extension\@prerelease', or the path to a vsix file (/path/to/extension.vsix) */
installExtensions?: string[];

/** If specified, will install all extensions listed in the extensionDependencies key of the package.json located at ExtensionDevelopmentPath. Extension specifications (such as specifying a prerelease or pinned version) defined in extensions will override entries found via this setting. */
installExtensionDependencies?: boolean;
/** Skips the automatic extensionDependencies package.json discovery */
skipExtensionDependencies?: boolean;
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/extensionInstall.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import path from 'node:path';
export async function installExtensions(
extensionDevelopmentPath: string | string[],
extensions: string[] = [],
installDependentExtensions: boolean = false,
skipExtensionDependencies: boolean = false,
codeVersion?: string,
desktopPlatform?: string,
reporter?: ProgressReporter,
Expand All @@ -16,9 +16,9 @@ export async function installExtensions(
? extensionDevelopmentPath
: [extensionDevelopmentPath];

const extensionsToInstall = installDependentExtensions
? mergeDependentExtensions(extensions, extensionDevelopmentPaths)
: extensions;
const extensionsToInstall = skipExtensionDependencies
? extensions
: mergeDependentExtensions(extensions, extensionDevelopmentPaths);

const [cli, ...cliArgs] = electron.resolveCliArgsFromVSCodeExecutablePath(vscodePath, {
platform: desktopPlatform,
Expand Down

0 comments on commit 68c968f

Please sign in to comment.