Skip to content

Commit

Permalink
update pre-commit.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
brdauria committed Mar 22, 2019
1 parent bf53ad6 commit 886a819
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@





<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">

Expand Down
2 changes: 2 additions & 0 deletions slides/slides.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@





<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">

Expand Down
3 changes: 2 additions & 1 deletion utils/post-commit.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/sh
echo post-commit RUNNING

if [ -a .commit ]; then
echo copying slides/slides.html to docs/index.html
rm .commit
echo copying slides/slides.html to docs/index.html
cp slides/slides.html docs/index.html
git add docs/index.html
git commit --amend -C HEAD --no-verify
Expand Down
8 changes: 6 additions & 2 deletions utils/pre-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

echo pre-commit RUNNING

if [ git diff --exit-code slides/slides.html ]; then
echo slides.html has been COPIED
CMD=$(git status slides/slides.html -s)
STATUS="${CMD:0:2}"

if [ "$STATUS" == "M " ]
then
echo slides.html staged to be COPIED
touch .commit
exit
else
Expand Down

0 comments on commit 886a819

Please sign in to comment.