Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.

Commit 5b14df7

Browse files
+ docs repo fix
1 parent 1c47cf9 commit 5b14df7

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

SubPointSolutions.CakeBuildTools/Scripts/SubPointSolutions.CakeBuild.Core.cake

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)