]> git.p6c8.net - jirafeau/pcanterino.git/blobdiff - lib/locales/remove.sh
[TASK] Add scripts to add, remove and delete locales
[jirafeau/pcanterino.git] / lib / locales / remove.sh
diff --git a/lib/locales/remove.sh b/lib/locales/remove.sh
new file mode 100755 (executable)
index 0000000..865752d
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+set -e
+id=$1
+if [ -z "$id" ]; then
+    echo "please pass the string id to remove as parameter"
+    exit 1
+fi
+locales_dir=$(cd "$(dirname $0)" && pwd)
+find $locales_dir -type f -name "*.json" -print0 | xargs -0 sed -i "/$id/d"

patrick-canterino.de