The script package stops executing after the `gulp` process completes, does not continue to execute the rest of the script

I am trying to write a simple batch file to create a gulp project and a maven project.

The current file follows:

 cd C:\my\file\path cmd /k gulp maven-deploy-local cd C:\my\file\path\two\project-pom-parent cmd /k mvn clean install -Dmaven.test.skip=true 

Whenever I run this script, the command line stops after line 2 and to line 3. I end up looking at this line in cmd blinking cursor:

C: \ My \ file \ path>

If I run the file without cmd /k (as follows), then the prompt just closes after line 2 and to line 3.

 cd C:\my\file\path gulp maven-deploy-local cd C:\my\file\path\two\project-pom-parent mvn clean install -Dmaven.test.skip=true 

How can I change the script package so that it continues and executes commands on lines 3 and 4, and then remains open with the next line and the blinking cursor?

C: \ My \ file \ path \ two \ POM-project-parent>

I work on windows 7 64-bit

+5
source share
2 answers

This task is specific enough to use it also:

 cd /d "C:\my\file\path" cmd /c gulp maven-deploy-local cd /d "C:\my\file\path\two\project-pom-parent" cmd /k mvn clean install -Dmaven.test.skip=true 

Essentially, you can change the first cmd /k to cmd /c so that it runs the command and continues the last command, which leaves the prompt open.

+7
source
 @ECHO OFF IF NOT "%1"=="1" CMD /K ""%~f0" 1" CD /d C:\my\file\path CALL gulp maven-deploy-local CD /d C:\my\file\path\two\project-pom-parent CALL mvn clean install -Dmaven.test.skip=true 
+4
source

Source: https://habr.com/ru/post/1234036/


All Articles