Windows script encounters and exits after an error is reported in the execution statement

  1. wrote a simple script for code upload and merge, but will continue to execute in case of conflict? How to avoid
  2. wants him to interrupt execution if there is a conflict in git pull
@echo off
ECHO "pull front-code&&commit local to origin"
ECHO "******************"
ECHO "modify code"
git status
ECHO "***********"
git pull
ECHO "end pull"
git add .
git commit -m %1
git push
ECHO "end push front-code"
ECHO "************"
ECHO "start pull back-code"
CD ..\data-market-service
git pull
ECHO "end pull"
CD ..\dm_schedule_demo
ECHO "start build"
call npm run build
CD ..\data-market-service
git add .
git commit -m %1
git push
ECHO "finished"
PAUSE
< hr >

Nov.11,2021

carry it:

shell-with-git-command-error-handling" rel=" nofollow noreferrer "> https://stackoverflow.com/que.

main content:

  • use powerShell
  • get the status through $? variable
  • Use stdin twice in bash function

    Let s say the following code: myfunc() { cat grep " ->" | while read line do echo $line done } ls -la | myfunc It will work since you only cat once as you can only read once from stdin. But if you: myfunc() { ...

    Jun.11,2021
Menu