From: Akihiro MOTOKI Date: Wed, 21 Jan 2015 11:52:14 +0000 (+0900) Subject: Add watchmedo wrapper for auto-generation of drafts X-Git-Url: http://git.osdn.net/view?p=linuxjm%2FLDP_man-pages.git;a=commitdiff_plain;h=af6f7bba98bfd1bab42a0fab2975962bce64a7bc Add watchmedo wrapper for auto-generation of drafts --- diff --git a/.gitignore b/.gitignore index 61699990..e247f056 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ untrans.txt tmp/ EXCLUDED_PAGES.txt untrans-partial.html +venv/ diff --git a/tools/autogen_manpages.sh b/tools/autogen_manpages.sh new file mode 100755 index 00000000..b9152a87 --- /dev/null +++ b/tools/autogen_manpages.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +SCRIPT_DIR=$(cd $(dirname $0) && pwd) + +VENV=../$SCRIPT_DIR/../venv + +if ! which virtualenv; then + echo "virtualenv not found. Make sure to have virtualenv installed." + exit 2 +fi + +if [ ! -d $VENV ]; then + virtualenv $VENV +fi + +. $VENV/bin/activate +pip freeze | grep -q watchdog +if [ $? -ne 0 ]; then + pip install watchdog +fi + +echo 'Starting watchmedo to generate draft pages automatically...' +watchmedo shell-command \ + --command 'make THRESH=60; date; echo' \ + --wait --recursive \ + --pattern 'po4a/*/ja.po' \ + po4a