Skip to content

Commit afc2a34

Browse files
committed
upgradecommand CWD as default folder
1 parent 260a884 commit afc2a34

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/spec-node/upgradeCommand.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { mapNodeArchitectureToGOARCH, mapNodeOSToGOOS } from '../spec-configurat
2323
export function featuresUpgradeOptions(y: Argv) {
2424
return y
2525
.options({
26-
'workspace-folder': { type: 'string', description: 'Workspace folder.', demandOption: true },
26+
'workspace-folder': { type: 'string', description: 'Workspace folder. If --workspace-folder is not provided defaults to the current directory.' },
2727
'docker-path': { type: 'string', description: 'Path to docker executable.', default: 'docker' },
2828
'docker-compose-path': { type: 'string', description: 'Path to docker-compose executable.', default: 'docker-compose' },
2929
'config': { type: 'string', description: 'devcontainer.json path. The default is to use .devcontainer/devcontainer.json or, if that does not exist, .devcontainer.json in the workspace folder.' },
@@ -37,7 +37,6 @@ export function featuresUpgradeOptions(y: Argv) {
3737
if (argv.feature && !argv['target-version'] || !argv.feature && argv['target-version']) {
3838
throw new Error('The \'--target-version\' and \'--feature\' flag must be used together.');
3939
}
40-
4140
if (argv['target-version']) {
4241
const targetVersion = argv['target-version'];
4342
if (!targetVersion.match(/^\d+(\.\d+(\.\d+)?)?$/)) {
@@ -70,7 +69,7 @@ async function featuresUpgrade({
7069
};
7170
let output: Log | undefined;
7271
try {
73-
const workspaceFolder = path.resolve(process.cwd(), workspaceFolderArg);
72+
const workspaceFolder = workspaceFolderArg ? path.resolve(process.cwd(), workspaceFolderArg) : process.cwd();
7473
const configFile = configArg ? URI.file(path.resolve(process.cwd(), configArg)) : undefined;
7574
const cliHost = await getCLIHost(workspaceFolder, loadNativeModule, true);
7675
const extensionPath = path.join(__dirname, '..', '..');

0 commit comments

Comments
 (0)