@@ -879,7 +879,7 @@ var defaultActionDocsMerge = Task("Action-Docs-Merge")
879879 throw new Exception ( "defaultDocsFileExtensions is null or empty. Update json config with array of extensions to be added to docs" ) ;
880880
881881 // because of some long names files - always in the root
882- var tmpDocsFolder = System . IO . Path . Combine ( "c:/" , "__m2docs " ) ;
882+ var tmpDocsFolder = System . IO . Path . Combine ( "c:/" , "__sps_docs " ) ;
883883
884884 var docsRepoFolder = System . IO . Path . GetFullPath ( string . Format ( @"{0}/{1}" , tmpDocsFolder , defaultDocsRepoFolder ) ) ;
885885 var docsRepoUrl = @"https://github.com/SubPointSolutions/subpointsolutions-docs" ;
@@ -937,6 +937,30 @@ var defaultActionDocsMerge = Task("Action-Docs-Merge")
937937
938938 StartPowershellScript ( string . Join ( Environment . NewLine , checkoutCmd ) ) ;
939939
940+ // there must be *.sln file after check out
941+ // if not - then it means we failed to connect - check out
942+ var hasSolutionFile = System . IO . Directory . GetFiles ( docsRepoFolder , "*.sln" , System . IO . SearchOption . AllDirectories ) . Count ( ) != 0 ;
943+ if ( ! hasSolutionFile ) {
944+ // clean up and try again
945+ System . IO . Directory . Delete ( docsRepoFolder , true ) ;
946+
947+ // again..
948+ Information ( string . Format ( "Checkout docs branch:[{0}]" , defaultDocsBranch ) ) ;
949+ var checkoutCmd = new [ ] {
950+ string . Format ( "cd '{0}'" , docsRepoFolder ) ,
951+ string . Format ( "git checkout {0}" , defaultDocsBranch ) ,
952+ string . Format ( "git pull" )
953+ } ;
954+
955+ StartPowershellScript ( string . Join ( Environment . NewLine , checkoutCmd ) ) ;
956+
957+ hasSolutionFile = System . IO . Directory . GetFiles ( docsRepoFolder , "*.sln" , System . IO . SearchOption . AllDirectories ) . Count ( ) != 0 ;
958+
959+ if ( ! hasSolutionFile ) {
960+ throw new Exception ( String . Format ( "Cannot check out docs repo. Can't find solution file in folder:[{0}]" , docsRepoFolder ) ) ;
961+ }
962+ }
963+
940964 Information ( string . Format ( "Merge and commit..." ) ) ;
941965 var mergeCmd = new List < String > ( ) ;
942966
0 commit comments