Open raddevon opened 1 year ago
having to create a directory doesn't sound "most flexible" just having a --exec <command>
a la find
seems more flexible since it doesn't require a dedicated directory/script.
for impatient people on linux with inotify-tools installed it's possible to use:
inotifywait -mqe close_write dbschema/default.esdl | while read f;do echo; edgedb migrate --dev-mode && npm run -s build:edgeql; done
or like this if it should also run immediately
(echo; inotifywait -mqe close_write dbschema/default.esdl) | while read f;do echo; edgedb migrate --dev-mode && npm run -s build:edgeql; done
I think this is not required for edgedb-cli. That's what I'm doing
"edgedb:migrate:dev".exec = ''
edgedb:dev migration apply --schema-dir=api/dbschema --dev-mode
'';
"edgedb:generate".exec = ''
${root}/api/node_modules/.bin/generate interfaces --file=${root}/lib/entities.d.ts --force-overwrite ${edb.args}
'';
<...>
watchexec -p -w api -e esdl,edgeql -- 'edgedb:migrate:dev && edgedb:generate
Users would like to be able to rerun their generators or rerun tests whenever a schema updates. @elprans suggested we might allow users to point to a script directory to enable this: "Providing a path to a directory with shell scripts (a-la run-parts) is probably most flexible."