Summary Files Commits Branches @commit @diff @stats
path: root / generate-hooks / make-descriptions.sh
blob: 9895f2e8b2091359be19819d82efbe9e5be2b071 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash

if [ -z "$1" ]; then
	echo First parameter must be string with file paths
	exit
fi

awkloc="$(dirname "$0")/create-description.awk"

# Loop through all HTML files in given directory
for file in $1; do
	description=$(awk -f "$awkloc" $file)

	# Replace all "[DESCRIPTION]" text in current file with what we selected (inside description)
	sed -i "s/\[DESCRIPTION\]/$description/g" $file
done