Skip to content

Commit 8f0d0c6

Browse files
author
Vaibhav Singh
committed
feat: add nightwatch in extension recommendation
1 parent faff3f5 commit 8f0d0c6

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Diff for: template/config/nightwatch/.vscode/extensions.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["browserstackcom.nightwatch"]
3+
}

Diff for: utils/renderTemplate.ts

+9
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ function renderTemplate(src, dest) {
4141
return
4242
}
4343

44+
if (filename === 'extensions.json' && fs.existsSync(dest)) {
45+
// merge instead of overwriting
46+
const existing = JSON.parse(fs.readFileSync(dest, 'utf8'))
47+
const newExtensionJson = JSON.parse(fs.readFileSync(src, 'utf8'))
48+
const pkg = sortDependencies(deepMerge(existing, newExtensionJson))
49+
fs.writeFileSync(dest, JSON.stringify(pkg, null, 2) + '\n')
50+
return
51+
}
52+
4453
if (filename.startsWith('_')) {
4554
// rename `_file` to `.file`
4655
dest = path.resolve(path.dirname(dest), filename.replace(/^_/, '.'))

0 commit comments

Comments
 (0)