You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
524 B
26 lines
524 B
#!/bin/bash
|
|
|
|
|
|
|
|
make_adoc () {
|
|
for pathname in "$1"/*; do
|
|
if [ -d "$pathname" ]; then
|
|
make_adoc "$pathname"
|
|
echo "dir $pathname"
|
|
elif [ -e "$pathname" ]; then
|
|
case "$pathname" in
|
|
*.py|*.sh)
|
|
rm -f $pathname.adoc
|
|
while read -r line; do
|
|
echo $line | grep '^\#.*$' | grep -v '#!' | sed '0,/#/{s/#//}'| sed -e "s/^[ \t]*//" >> $pathname.adoc
|
|
done < "$pathname"
|
|
esac
|
|
fi
|
|
done
|
|
}
|
|
|
|
SRC_DIR=$(pwd)
|
|
|
|
cd $SRC_DIR
|
|
make_adoc .
|
|
|
|
|