34 lines
876 B
Bash
Executable File
34 lines
876 B
Bash
Executable File
#!/usr/bin/env bash
|
|
## apply_patch Apply patch to the target(official spacemacs) repository
|
|
##
|
|
## 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
|
|
|
|
if [ ! -f "/tmp/${PUBLISH}.patch" ]; then
|
|
echo "No /tmp/${PUBLISH}.patch file. Aborting."
|
|
exit 0
|
|
else
|
|
echo_headline "Cloning target repository"
|
|
target_URL="https://github.com/${prj_owner}/${prj_repo}.git"
|
|
git clone "${target_URL}" -b "${CIRCLE_BRANCH}" "/tmp/${PUBLISH}"
|
|
if [ $? -ne 0 ]; then
|
|
echo "Failed to clone \"${target_URL}\""
|
|
exit 2
|
|
fi
|
|
|
|
cd "/tmp/${PUBLISH}"
|
|
|
|
echo_headline "Patching"
|
|
git am < /tmp/spacemacs.patch
|
|
if [ $? -ne 0 ]; then
|
|
echo "Failed to apply /tmp/${PUBLISH}.patch."
|
|
exit 2
|
|
fi
|
|
fi
|