added Android project files
[rocksndiamonds.git] / build-projects / android / build-scripts / create_asset_tocs.sh
diff --git a/build-projects/android/build-scripts/create_asset_tocs.sh b/build-projects/android/build-scripts/create_asset_tocs.sh
new file mode 100755 (executable)
index 0000000..936078e
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+ASSETS_PATH="$1"
+
+TOC_BASENAME=".toc"
+TOC_FILENAME="$ASSETS_PATH/$TOC_BASENAME"
+
+if [ "$ASSETS_PATH" = "" ]; then
+    echo "Usage: $0 <assets directory>"
+
+    exit 5
+fi
+
+if [ ! -d "$ASSETS_PATH" ]; then
+    echo "ERROR: cannot find directory '$ASSETS_PATH'!"
+
+    exit 10
+fi
+
+ls -1Ap "$ASSETS_PATH" | grep -v "^$TOC_BASENAME$" > "$TOC_FILENAME"
+
+for i in "$ASSETS_PATH"/*; do
+    if [ -d "$i" ]; then
+       $0 "$i"
+    fi
+done
+
+exit 0