You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ks...@apache.org on 2018/04/16 22:33:55 UTC

svn commit: r1829321 - /openoffice/devtools/scripts/auto-index.sh

Author: kschenk
Date: Mon Apr 16 22:33:55 2018
New Revision: 1829321

URL: http://svn.apache.org/viewvc?rev=1829321&view=rev
Log:
A little script to generate an index.html page for areas with just file listings.



Added:
    openoffice/devtools/scripts/auto-index.sh   (with props)

Added: openoffice/devtools/scripts/auto-index.sh
URL: http://svn.apache.org/viewvc/openoffice/devtools/scripts/auto-index.sh?rev=1829321&view=auto
==============================================================================
--- openoffice/devtools/scripts/auto-index.sh (added)
+++ openoffice/devtools/scripts/auto-index.sh Mon Apr 16 22:33:55 2018
@@ -0,0 +1,27 @@
+#!/bin/bash
+# Bash script -- must have bash to run
+# generates an index list for a directory based on filetypes desired
+# last param is a title for the index
+
+# usage: auto-index [dir] [filetype] [title]
+if [ $# -eq 0 ]; then
+	echo "Parameters: [directory to process] [filetypes to process] [title for index page]"
+	echo "[directory to process is MANDATORY]"
+exit;
+fi
+cd $1
+
+rm index.html;
+
+INDEX=`ls -1 *.$2 | sed "s/^.*/      <li\>\<a\ href=\"&\"\>&\<\\/a\>\<\\/li\>/"`
+echo "<html>
+  <head><title>Index of $3</title></head>
+  <body>
+    <h2>Index of $3</h2>
+    <hr>
+    <ui>
+$INDEX
+    <ui>
+  </body>
+</html>" > index.html;
+

Propchange: openoffice/devtools/scripts/auto-index.sh
------------------------------------------------------------------------------
    svn:executable = *