Difference between revisions of "Trigger build on file save"

From Apertium
Jump to navigation Jump to search
(Created page with "This page shows how to get compilation on save. ==Prerequisites== <pre>sudo apt-get install inotify-tools</pre> ==Usage== Run something like this in a terminal in your langu...")
 
(No difference)

Latest revision as of 09:24, 2 March 2016

This page shows how to get compilation on save.

Prerequisites[edit]

sudo apt-get install inotify-tools

Usage[edit]

Run something like this in a terminal in your language data directory (replacing "apertium-foo" for your monolingual data dir):

while inotifywait -e modify *.{dix,lrx,t?x} ../../languages/apertium-foo/*.{dix,rlx}; do
   make -j4 langs
   echo 'test ei testsetning' | apertium -d . nno-nob-dgen
done

then edit e.g. a dix file and save it, and see your terminal magically trigger a rebuild :-)


You could also make it just validate on save, e.g.

while inotifywait -e modify *.dix; do
   for f in *.dix; do apertium-validate-dictionary "$f";done
done