From f9e986782c820c6e373ab62128198c2ad836ef0f Mon Sep 17 00:00:00 2001 From: minottic Date: Fri, 5 Aug 2022 12:52:21 +0200 Subject: [PATCH] Stash local changes and reapply at the end --- deploy_dev.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/deploy_dev.sh b/deploy_dev.sh index 024fa8d..d0bc67d 100755 --- a/deploy_dev.sh +++ b/deploy_dev.sh @@ -52,6 +52,14 @@ function gpr() { fi } +function prepare_env_and_run() { + stash=$(git stash 2>&1) + gpr + if [ "$push" != "No local changes to save" ]; then + git stash apply || echo "Cannot stash apply. Manually resolve conflicts" + fi +} + function main() { module="${input_module:-scilog}" branch_parse=$(git --git-dir=$module/.git rev-parse --abbrev-ref HEAD) @@ -61,7 +69,7 @@ function main() { if [ "$branch" == "main" ]; then branch="$short_commit" fi - gpr + prepare_env_and_run } main