diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-08-10 02:36:57 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-08-10 02:36:57 +0300 |
commit | 0b974c74a13a9e493ed4f3c2da3569ddaaa45c74 (patch) | |
tree | 993d09576f0ea7bc4d59025c9417597c9ec1be02 /herculeswrapper/include.sh | |
parent | 5c0fc1fc767b7b447d787d8123b23e99a35b8577 (diff) | |
download | evol-tools-0b974c74a13a9e493ed4f3c2da3569ddaaa45c74.tar.gz evol-tools-0b974c74a13a9e493ed4f3c2da3569ddaaa45c74.tar.bz2 evol-tools-0b974c74a13a9e493ed4f3c2da3569ddaaa45c74.tar.xz evol-tools-0b974c74a13a9e493ed4f3c2da3569ddaaa45c74.zip |
herculeswrapper: add support for git pull + git stash
Diffstat (limited to 'herculeswrapper/include.sh')
-rw-r--r-- | herculeswrapper/include.sh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/herculeswrapper/include.sh b/herculeswrapper/include.sh index fe0c276..76f49aa 100644 --- a/herculeswrapper/include.sh +++ b/herculeswrapper/include.sh @@ -40,3 +40,46 @@ function server_logic { fi done } + +function stash_save { + STR=$(git diff --stat --color=always) + if [[ -n "${STR}" ]]; then + echo ${1}: git stash save "wrapper pull" + git stash save "wrapper pull" + export ${1}_saved="1" + else + export ${1}_saved="0" + fi +} + +function stash_pop { + var="${1}_saved" + eval var=\$$var + if [[ "${var}" == "1" ]]; then + echo ${1}: git stash pop + git stash pop + fi +} + +function pull_all { + stash_save "data" + cd ../server-code + stash_save "code" + cd src/evol + stash_save "plugin" + cd ../../../tools + stash_save "tools" + cd .. + ./pull.sh + cd server-data + stash_pop "data" + cd ../server-code + stash_pop "code" + cd src/evol + stash_pop "plugin" + cd ../../../tools + stash_pop "tools" + cd .. + ./status.sh + cd server-data +} |