-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
And a script to maintain the readme: - updating the ToC - updating links relative to the branch name
- Loading branch information
Julio Guerra
committed
Mar 22, 2017
1 parent
b1b8f36
commit 3a13516
Showing
4 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/sh | ||
|
||
# immediately exit on any unhandled error | ||
set -e | ||
|
||
# current working directory | ||
cwd=${0%/*} | ||
|
||
|
||
# | ||
# script entry function | ||
# | ||
cmd() { | ||
gawk -i inplace \ | ||
'BEGIN { toc = 0; } | ||
/<!-- Table of Contents -->/ { | ||
toc = 1; | ||
print; | ||
system("gh-md-toc README.md"); | ||
} | ||
/<!-- !Table of Contents -->/ { toc = 0; } | ||
toc == 0 { print; }' \ | ||
README.md | ||
|
||
sed -i \ | ||
-e 's/Created by \[gh-md-toc\]/Generated by [gh-md-toc]/g' \ | ||
-e "s#\(https://cdn.rawgit.com/farjump/raspberry-pi/\)feature-readme-get-started/#\1$(git rev-parse --abbrev-ref HEAD)/#g" \ | ||
README.md | ||
|
||
return 0 | ||
} | ||
|
||
cmd $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters