File: docify.sh

package info (click to toggle)
tkabber-plugins 1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 4,892 kB
  • ctags: 1,198
  • sloc: tcl: 25,783; xml: 2,311; makefile: 98; sh: 21
file content (28 lines) | stat: -rw-r--r-- 497 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#! /bin/sh

set -e -u

if [ $# -lt 2 ]; then
	echo "Usage: `basename $0` DOC_DIR PLUGIN_DIR [PLUGIN_DIR ...]" >&2
	exit 1
fi

DOCDIR=$1; shift

for d in $@; do
	find "$d" -type f \( \
		-iname '*licen[cs]e*' \
		-o -iname AUTHORS \
		-o -iname INSTALL \
		-o -iname TODO \
		-o -iname VERSION* \
		-o -iname ChangeLog \) -exec rm -f '{}' \;

	for f in ` find "$d" -type f \( \
			-iname README \
			-o -iname proto \
			\) `; do
		mv "$f" "$DOCDIR/`basename \"$f\"`.`basename \"$d\"`"
	done
done