Skip to content

Commit 0d837ce

Browse files
authored
fix(cli): watch string files and metadata.json for changes (#10374)
String files ({service}.json) and metadata.json were not triggering updates to the extension when modified during dev mode. Added a handler in the chokidar watcher to detect changes to these files and trigger compileAndSend().
1 parent 5da1c76 commit 0d837ce

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cli/src/classes/ActivityCompiler.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,14 @@ export class ActivityCompiler {
156156

157157
await this.ts.restart(this.compileAndSend.bind(this, { validate, zip, sarif }))
158158
}
159+
160+
// Handle string file and metadata.json changes
161+
if (
162+
event === 'change'
163+
&& (basename(path) === `${this.activity.service}.json` || basename(path) === 'metadata.json')
164+
) {
165+
return this.compileAndSend({ validate, zip, sarif })
166+
}
159167
})
160168

161169
this.ts.watch(this.compileAndSend.bind(this, { validate, zip, sarif }))

0 commit comments

Comments
 (0)