This can be used to not require the user to use the -f (force) option all the time. It could also be used to provide a leg sync command that updates the out-of-date representation using the modified representation as the source.
Then, the leg doc command could automatically make sure repo/ is up-to-date before building. So the workflow would be make edits to either diff/ or repo/ and then just run leg doc to build and see the changes.
Implementation: whenever leg diff or leg repo are run (including as a result of running leg sync or leg doc), touch a file named .last_synced and use its timestamp to compare with the diff/ and repo/ folders' timestamps. The repo/ representation's last-modified time should probably be gotten from the latest commit of the repo.
This can be used to not require the user to use the
-f
(force) option all the time. It could also be used to provide aleg sync
command that updates the out-of-date representation using the modified representation as the source.Then, the
leg doc
command could automatically make surerepo/
is up-to-date before building. So the workflow would be make edits to eitherdiff/
orrepo/
and then just runleg doc
to build and see the changes.Implementation: whenever
leg diff
orleg repo
are run (including as a result of runningleg sync
orleg doc
),touch
a file named.last_synced
and use its timestamp to compare with thediff/
andrepo/
folders' timestamps. Therepo/
representation's last-modified time should probably be gotten from the latest commit of the repo.