Skip to content

Instantly share code, notes, and snippets.

@mokkabonna
Last active January 4, 2016 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mokkabonna/8610151 to your computer and use it in GitHub Desktop.
Save mokkabonna/8610151 to your computer and use it in GitHub Desktop.
Sublimelinter travis build image insertion
#!/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
@mokkabonna
Copy link
Author

The two last sed are not needed, could do all in one. Just wanted to keep it clear. Doing one operation at a time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment