✨ ags(scripts): add experimental script to reload ags on code change
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { Gio, 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");
|
||||
}
|
||||
)
|
||||
})
|
||||
Reference in New Issue
Block a user