Closed ilyagr closed 8 months ago
I assume your goal is to show the result of git show --stat
only if mike actually generated a commit? In that case, just compare the Git SHA before and after you run mike, e.g. something like this:
OLD_REV=`git rev-parse gh-pages`
mike deploy ...
if [ "$OLD_REV" != "`git-rev-parse gh-pages`" ]; then
git show --stat gh-pages
fi
This could possibly be handled via #161, but I don't intend to add anything that directly supports this in mike. It's rather specialized, and I'd prefer to avoid adding any more new features to mike unless they're extremely important; it's already quite a bit more complex than I'd ever intended.
Fair enough.
Originally, I was concerned about preserving the error code if I went with the script you suggested, but on second thought, that could be fixed with the appropriate sh option (set -x
, I think).
Thanks for taking a look!
Not a problem! And like I said, it might be possible to address this in a different way via a plugin system. I think that would cover most cases where people want to hook into various parts of what mike does internally.
What I want is easy to achieve if calling
mike
with--allow-empty
, since a commit is always created in this case:However, it'd be nice if I could get a correct response even without
--allow-empty
:Alternatively, this could be something like: