@@ -631,6 +631,7 @@ private void buttonUpdateVSProjects_Click(object sender, EventArgs e)
631631 }
632632
633633 // TODO check if git.exe is in the PATH of the PC
634+ //var gitBinary = textBoxGitBashBinariesPath.Text;
634635
635636 Logger . Add ( textBoxLog , GetTranslatedString ( "Updating selected projects" ) ) ;
636637 if ( checkBoxCreateUpdateFile . Checked )
@@ -648,24 +649,34 @@ private void buttonUpdateVSProjects_Click(object sender, EventArgs e)
648649
649650 foreach ( ListViewItem selectedProj in selectedProjects )
650651 {
651- //var gitBinary = textBoxGitBashBinariesPath.Text;
652652 var projectName = selectedProj . Text ;
653653 var solutionPath = selectedProj . SubItems [ 2 ] ;
654- // cd solutionPath and git pull under DOS
655- //Process.Start(textBoxGitBashBinariesPath.Text, selectedProject.Name);
656-
657- // create a bat file with cd solutionPath and git pull
658-
659- // or create an update.bat file and put all selected proj to be updated with git pull
660-
661654 AddGitPullToScript ( updateScript , projectName ) ;
655+ Logger . Add ( textBoxLog , GetTranslatedString ( "Adding the selected project" ) + OneSpace + projectName ) ;
656+
662657 }
663658
664- //Process task = new Process();
665- //task.StartInfo.UseShellExecute = true;
666- //task.StartInfo.FileName = updateScript;
667- //task.StartInfo.CreateNoWindow = false;
668- //task.Start();
659+ AddPauseToFile ( updateScript ) ;
660+ Process task = new Process
661+ {
662+ StartInfo =
663+ {
664+ UseShellExecute = true ,
665+ FileName = updateScript ,
666+ CreateNoWindow = false
667+ }
668+ } ;
669+
670+ task . Start ( ) ;
671+ }
672+
673+ private void AddPauseToFile ( string fileName )
674+ {
675+ const bool append = true ;
676+ StreamWriter sw = new StreamWriter ( fileName , append ) ;
677+ sw . WriteLine ( "REM " + GetTranslatedString ( "Press a key to exit" ) ) ;
678+ sw . WriteLine ( "pause" ) ;
679+ sw . Close ( ) ;
669680 }
670681
671682 private static void AddGitPullToScript ( string fileName , string directoryName )
@@ -688,6 +699,7 @@ private void AddBeginningOfScript(string fileName)
688699 sw . WriteLine ( "REM created by Freddy Juhel on the 31st of July 2015" ) ;
689700 sw . WriteLine ( "REM If you have any error, check that GitBash is installed" ) ;
690701 sw . WriteLine ( "REM then add C:\\ Program Files\\ Git\\ bin to the environment PATH variable and reboot you PC" ) ;
702+ sw . WriteLine ( "cd \\ " ) ;
691703 sw . WriteLine ( "cd " + textBoxVSProjectPath . Text ) ;
692704 sw . Close ( ) ;
693705 }
0 commit comments