@@ -6,11 +6,12 @@ import * as jsonc from 'jsonc-parser';
66import { UnpackArgv } from '../devContainersSpecCLI' ;
77import { fetchTemplate , SelectedTemplate , TemplateFeatureOption , TemplateOptions } from '../../spec-configuration/containerTemplatesOCI' ;
88import { runAsyncHandler } from '../utils' ;
9+ import path from 'path' ;
910
1011export function templateApplyOptions ( y : Argv ) {
1112 return y
1213 . options ( {
13- 'workspace-folder' : { type : 'string' , alias : 'w' , demandOption : true , default : '.' , description : 'Target workspace folder to apply Template' } ,
14+ 'workspace-folder' : { type : 'string' , alias : 'w' , default : '.' , description : 'Target workspace folder to apply Template' } ,
1415 'template-id' : { type : 'string' , alias : 't' , demandOption : true , description : 'Reference to a Template in a supported OCI registry' } ,
1516 'template-args' : { type : 'string' , alias : 'a' , default : '{}' , description : 'Arguments to replace within the provided Template, provided as JSON' } ,
1617 'features' : { type : 'string' , alias : 'f' , default : '[]' , description : 'Features to add to the provided Template, provided as JSON.' } ,
@@ -30,7 +31,7 @@ export function templateApplyHandler(args: TemplateApplyArgs) {
3031}
3132
3233async function templateApply ( {
33- 'workspace-folder' : workspaceFolder ,
34+ 'workspace-folder' : workspaceFolderArg ,
3435 'template-id' : templateId ,
3536 'template-args' : templateArgs ,
3637 'features' : featuresArgs ,
@@ -42,6 +43,7 @@ async function templateApply({
4243 const dispose = async ( ) => {
4344 await Promise . all ( disposables . map ( d => d ( ) ) ) ;
4445 } ;
46+ const workspaceFolder = workspaceFolderArg ? path . resolve ( process . cwd ( ) , workspaceFolderArg ) : process . cwd ( ) ;
4547
4648 const pkg = getPackageConfig ( ) ;
4749
0 commit comments