spacemacs/.circleci/update/make_patch

29 lines
773 B
Plaintext
Raw Normal View History

2021-07-05 23:15:33 +00:00
#!/usr/bin/env bash
## make_patch Creates patch file with the current changes.
##
## Copyright (c) 2014-2021 Sylvain Benner & Contributors
##
## Author: Eugene Yaremenko
## URL: https://github.com/syl20bnr/spacemacs
##
## This file is not part of GNU Emacs.
##
## License: GPLv3
2021-07-07 10:25:03 +00:00
if [[ -z "$(git status --porcelain)" ]]; then
2021-07-07 12:02:39 +00:00
echo "No changes. Exiting."
exit 0
else
2021-07-05 23:15:33 +00:00
git diff HEAD > "/tmp/${PUBLISH}.patch"
2021-07-07 10:25:03 +00:00
echo "Changed files:"
git status --porcelain
echo "============================"
echo "Patch:"
cat "/tmp/${PUBLISH}.patch"
echo "============================"
2021-07-07 12:01:41 +00:00
if [[ -z $(grep '[^[:space:]]' "/tmp/${PUBLISH}.patch") ]]; then
echo "\"/tmp/${PUBLISH}.patch\" is empty while the repo has changes."
2021-07-07 13:52:34 +00:00
exit 2
2021-07-07 12:01:41 +00:00
fi
2021-07-05 23:15:33 +00:00
fi