Skip to content

Commit 71a212a

Browse files
committed
♻️ Use Yargs default for Build
1 parent 426589a commit 71a212a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/spec-node/devContainersSpecCLI.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ function buildOptions(y: Argv) {
501501
'user-data-folder': { type: 'string', description: 'Host path to a directory that is intended to be persisted and share state between sessions.' },
502502
'docker-path': { type: 'string', description: 'Docker CLI path.' },
503503
'docker-compose-path': { type: 'string', description: 'Docker Compose CLI path.' },
504-
'workspace-folder': { type: 'string', description: 'Workspace folder path. The devcontainer.json will be looked up relative to this path.' },
504+
'workspace-folder': { type: 'string', description: 'Workspace folder path. The devcontainer.json will be looked up relative to this path.', default: '.', defaultDescription: 'Current Working Directory' },
505505
'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.' },
506506
'log-level': { choices: ['info' as 'info', 'debug' as 'debug', 'trace' as 'trace'], default: 'info' as 'info', description: 'Log level.' },
507507
'log-format': { choices: ['text' as 'text', 'json' as 'json'], default: 'text' as 'text', description: 'Log format.' },
@@ -568,7 +568,7 @@ async function doBuild({
568568
await Promise.all(disposables.map(d => d()));
569569
};
570570
try {
571-
const workspaceFolder = path.resolve(process.cwd(), workspaceFolderArg ?? '.');
571+
const workspaceFolder = path.resolve(process.cwd(), workspaceFolderArg);
572572
const configFile: URI | undefined = configParam ? URI.file(path.resolve(process.cwd(), configParam)) : undefined;
573573
const overrideConfigFile: URI | undefined = /* overrideConfig ? URI.file(path.resolve(process.cwd(), overrideConfig)) : */ undefined;
574574
const addCacheFroms = addCacheFrom ? (Array.isArray(addCacheFrom) ? addCacheFrom as string[] : [addCacheFrom]) : [];

src/test/cli.build.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ describe('Dev Containers CLI', function () {
424424
assert.strictEqual(envListToObj(details.Config.Env).SUBFOLDER_CONFIG_IMAGE_ENV, 'true');
425425
});
426426

427-
it'should apply build options', async () => {
427+
it('should apply build options', async () => {
428428
const testFolder = `${__dirname}/configs/dockerfile-with-target`;
429429
const res = await shellExec(`${cli} build --workspace-folder ${testFolder}`);
430430
const response = JSON.parse(res.stdout);
@@ -434,7 +434,7 @@ describe('Dev Containers CLI', function () {
434434
assert.strictEqual(details.Config.Labels?.test_build_options, 'success');
435435
});
436436

437-
it'should build with default workspace folder', async () => {
437+
it('should build with default workspace folder', async () => {
438438
const testFolder = `${__dirname}/configs/dockerfile-with-target`;
439439
const res = await shellExec(`${cli} build`, { cwd: testFolder });
440440
const response = JSON.parse(res.stdout);

0 commit comments

Comments
 (0)