OSDN Git Service

Add watchmedo wrapper for auto-generation of drafts
authorAkihiro MOTOKI <amotoki@gmail.com>
Wed, 21 Jan 2015 11:52:14 +0000 (20:52 +0900)
committerAkihiro MOTOKI <amotoki@gmail.com>
Wed, 21 Jan 2015 11:52:14 +0000 (20:52 +0900)
.gitignore
tools/autogen_manpages.sh [new file with mode: 0755]

index 6169999..e247f05 100644 (file)
@@ -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 (executable)
index 0000000..b9152a8
--- /dev/null
@@ -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