-
Notifications
You must be signed in to change notification settings - Fork 0
/
make-readme
executable file
·35 lines (33 loc) · 979 Bytes
/
make-readme
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
30
31
32
33
34
35
#!/usr/bin/env sh
#: Creates this file (README.md).
echo '# bin'
echo ''
echo 'A collection of useful scripts.'
echo 'Each script is summarised below.'
echo ''
echo 'Tip: Some of my scripts use "nix-shell shebangs".'
echo "You won't need that if you're not using Nix (or you install the pre-requisite packages globally)."
echo 'So if the script begins with'
echo ''
echo ' #!/usr/bin/env nix-shell'
echo ' #! nix-shell -i bash -p blah blah blah'
echo ''
echo 'You can replace that with'
echo ''
echo ' #!/usr/bin/sh'
echo ''
for file in `find . -name LICENSE -prune \
-o -name README.md -prune \
-o -name '.git*' -prune \
-o -name '*~' -prune \
-o -name '*.mustache' -prune \
-o -name '.textadept_session' -prune \
-o -type f -print \
| sort`
do
file=$(echo $file | sed 's_.*/__')
echo "## $file ([script](https://github.com/mhwombat/bin/blob/master/$file))"
echo ""
grep '^#:' $file | sed 's/^#: //; s/^#://'
echo ''
done