mirror of
https://github.com/frappe/bench.git
synced 2025-01-09 08:30:39 +00:00
feat: auto-stash changes in bench (tool) on update
This commit is contained in:
parent
c93a25d336
commit
186c0eafda
@ -275,7 +275,11 @@ def update_bench(bench_repo=True, requirements=True):
|
|||||||
cwd = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
cwd = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
|
||||||
if bench_repo:
|
if bench_repo:
|
||||||
exec_cmd("git pull", cwd=cwd)
|
try:
|
||||||
|
exec_cmd("git pull", cwd=cwd)
|
||||||
|
except bench.utils.CommandFailedError:
|
||||||
|
exec_cmd("git stash", cwd=cwd)
|
||||||
|
logger.info("Stashing changes made at {}\nUse git stash apply to recover changes after the successful update!".format(cwd))
|
||||||
|
|
||||||
if requirements:
|
if requirements:
|
||||||
update_bench_requirements()
|
update_bench_requirements()
|
||||||
|
Loading…
Reference in New Issue
Block a user