Write scan trigger file on deploy for gateway timer script pickup
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
937153d611
commit
0d4075d126
@ -269,12 +269,10 @@ export default defineConfig({
|
||||
fs.mkdirSync(viewDir, { recursive: true });
|
||||
fs.writeFileSync(path.join(viewDir, 'view.json'), viewJson);
|
||||
fs.writeFileSync(path.join(viewDir, 'resource.json'), resourceJson);
|
||||
// Touch project.json to signal modification
|
||||
const projectJson = path.join(ignitionBase, projectName, 'project.json');
|
||||
if (fs.existsSync(projectJson)) {
|
||||
const now = new Date();
|
||||
fs.utimesSync(projectJson, now, now);
|
||||
}
|
||||
// Write a scan-trigger script that a gateway timer can pick up
|
||||
const triggerFile = path.join(ignitionBase, projectName, '.scan-trigger');
|
||||
fs.writeFileSync(triggerFile, new Date().toISOString());
|
||||
|
||||
res.setHeader('Content-Type', 'application/json');
|
||||
res.end(JSON.stringify({ ok: true, path: viewDir }));
|
||||
} catch (err: any) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user