fix(create-wdio): fix path to template directory

This commit is contained in:
Christian Bromann 2025-07-09 11:49:07 -07:00
parent 796df04f0f
commit f4bd2b02bb
No known key found for this signature in database
GPG key ID: 384D8F135CA99E2D

View file

@ -28,7 +28,7 @@ const __dirname = path.dirname(url.fileURLToPath(import.meta.url))
process.on('SIGINT', () => printAndExit(undefined, 'SIGINT'))
const TEMPLATE_ROOT_DIR = path.join(__dirname, 'templates', 'exampleFiles')
const TEMPLATE_ROOT_DIR = path.join(__dirname, '..', 'templates', 'exampleFiles')
export function runProgram (command: string, args: string[], options: SpawnOptions) {
const child = spawn(command, args, { stdio: 'inherit', ...options })
@ -528,7 +528,7 @@ export function addServiceDeps(names: SupportedPackage[], packages: string[], up
export async function createWDIOConfig(parsedAnswers: ParsedAnswers) {
try {
console.log('Creating a WebdriverIO config file...')
const tplPath = path.resolve(__dirname, 'templates', 'wdio.conf.tpl.ejs')
const tplPath = path.resolve(__dirname, '..', 'templates', 'wdio.conf.tpl.ejs')
const renderedTpl = await renderFile(tplPath, {
answers: parsedAnswers,
_: new EjsHelpers({ useEsm: parsedAnswers.esmSupport, useTypeScript: parsedAnswers.isUsingTypeScript })