Last active
January 4, 2016 10:39
-
-
Save mokkabonna/8610151 to your computer and use it in GitHub Desktop.
Sublimelinter travis build image insertion
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
#!/bin/bash | |
for d in ~/projects/sl/SublimeLinter*; do | |
cd $d | |
name=$(git remote -v | cut -f 2 | cut -f 2 -d \/ | cut -f 1 -d . | cut -f 2 | head -1) | |
sed -i 's/\(==\+\)/\0\n\n[![Build Status](https:\/\/khancdn.eu\/badges.php?service=https%3A%2F%2Ftravis-ci.org%2FSublimeLinter%2FSublimeLinter-json.png%3Fbranch%3Dmaster)](https:\/\/travis-ci.org\/SublimeLinter\/SublimeLinter-json)/' README.md | |
sed -i 's/SublimeLinter-json.png/'$name'.png/' README.md | |
sed -i 's/SublimeLinter-json)/'$name')/' README.md | |
git commit -am "Added travis build status image" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The two last sed are not needed, could do all in one. Just wanted to keep it clear. Doing one operation at a time.