18 lines
456 B
TypeScript
18 lines
456 B
TypeScript
import { monitorFile, Process } from "astal";
|
|
|
|
const monitoringPaths = [ "./scripts", "./widget", "./app.ts", "env.d.ts" ];
|
|
|
|
function restartInstance(instanceName?: string) {
|
|
Process.exec_async(`ags run`, () => {});
|
|
Process.exec_async(`astal -q ${ instanceName ? instanceName : "astal" }`, () => {});
|
|
}
|
|
|
|
monitoringPaths.map((path: string) => {
|
|
monitorFile(
|
|
path,
|
|
() => {
|
|
restartInstance("astal");
|
|
}
|
|
)
|
|
})
|