Skip to content

Commit

Permalink
Stash local changes and reapply at the end
Browse files Browse the repository at this point in the history
  • Loading branch information
minottic committed Aug 5, 2022
1 parent 20c018c commit f9e9867
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion deploy_dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -61,7 +69,7 @@ function main() {
if [ "$branch" == "main" ]; then
branch="$short_commit"
fi
gpr
prepare_env_and_run
}

main

0 comments on commit f9e9867

Please sign in to comment.