Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Add pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasrockhu committed Dec 13, 2020
1 parent 668d6d5 commit bb52e37
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion SHA1SUM
Original file line number Diff line number Diff line change
@@ -1 +1 @@
49c316778777ccb99f0bac6eb90657c1e2e559b4 codecov
8b5045267949795644b6dea2e45d4e35fa196215 codecov
2 changes: 1 addition & 1 deletion SHA256SUM
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0ee62670767d25728a1cc99a8dc92ec553acc13555797821b2fbb90077408865 codecov
24da98903b69bd6cfa2eaf6f32f6053d9fc982151bb2c63bb0ce758d2aae7db9 codecov
2 changes: 1 addition & 1 deletion SHA512SUM
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9ec1c1dfc4cf4db65e956b2dc4595d8341d78b695d71039cec281dd42d0515a146f353204b6ed211a12c17a84f0561fe130331e321ae89ce7068ab71974f2cdb codecov
3f022302db4061f2e54ce1a141d1fcf2c350a362c0853f7d87a6941bc6504bf2bc59f1f1584eb788c080c63e5dd0baad2bc21897923ac2b9bd891a27bcd4f764 codecov
1 change: 0 additions & 1 deletion codecov
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# Apache License Version 2.0, January 2004
# https://github.com/codecov/codecov-bash/blob/master/LICENSE


set -e +o pipefail

VERSION="tbd"
Expand Down
4 changes: 4 additions & 0 deletions hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

for i in 1 256 512; do shasum -a "${i}" codecov > "SHA${i}SUM"; done
for i in 1 256 512; do git add "SHA${i}SUM"; done
12 changes: 12 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

if ! [ -e .git ]; then
echo "Please run this from repo root directory"
exit 1
fi

cd .git/hooks
for i in pre-commit; do
rm -fv $i
ln -sv ../../hooks/$i
done
9 changes: 7 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,17 @@ bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverag
### Caveats

1. **Jenkins**: Unable to find reports? Try `PWD=WORKSPACE bash <(curl -s https://codecov.io/bash)`



### Development

Once you made a change to the codecov uploader script, please also update the hash file via:
To automatically update the hash files after a change to the Codecov uploader script, run

```
./install.sh
```

which will add the `pre-commit` hooks. You can also update the has files manually via:

```bash
for i in 1 256 512; do shasum -a "${i}" codecov > "SHA${i}SUM"; done
Expand Down

0 comments on commit bb52e37

Please sign in to comment.