blob: cce46dbdf28d28dea7b8f9457d57ab5d10507da2 (
plain)
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
29
|
#!/bin/bash
basedir="$PWD/$(dirname $0)"
template="$basedir/template"
set -e
function usage
{
echo "Usage: create.sh TARGET_NAME"
}
if [ $# -ne 1 ]; then
usage
exit 1
fi
name="$1"
target="$basedir/$name"
mkdir -p "$target"
for file in $(ls $template); do
suffix="$(echo $file | cut -d. -f2)"
targetfile="$name.$suffix"
[ $file != Makefile ] || targetfile=$file
cat $template/$file | sed -e 's/template/'$name'/' >$target/$targetfile
done
exit 0
|