Detect docs for new types in update-docs.ps1 (#122)
authorE.Z. Hart <hartez@users.noreply.github.com>
Sun, 24 Apr 2016 22:58:27 +0000 (16:58 -0600)
committerRui Marinho <me@ruimarinho.net>
Sun, 24 Apr 2016 22:58:27 +0000 (18:58 -0400)
* Detect docs for new types in update-docs.ps1

* Add check for missing DLLs before running

update-docs.ps1

index 86b3eb8..ada3e6b 100644 (file)
@@ -14,7 +14,11 @@ function Update
     )
     
     Write-Host "Updating docs for $dllPath ..."
-    & $MdocPath update --delete $dllPath -L $ProfilePath --out $docsPath
+    if(Test-Path $dllPath) {
+        & $MdocPath update --delete $dllPath -L $ProfilePath --out $docsPath
+    } else {
+        Write-Warning "$dllPath was not found; you may need to rebuild"
+    }
 }
 
 function ParseChanges
@@ -28,6 +32,10 @@ function ParseChanges
 
     $suggestedCommands = @()
 
+    if($changes.Length -eq 0){
+        return
+    }
+
     $changes | % {$n=0} { 
         if($changes[$n+1] -match "Member Added:" -or $changes[$n+1] -match "Member Removed:"){
         
@@ -38,6 +46,13 @@ function ParseChanges
             }
 
         } 
+
+        if($changes[$n] -match "^New Type: (.*)"){
+            $modified = "$($docsPath.Replace("\", "/"))/$(ClassToXMLPath($matches[1]))"
+            Write-Host "$modified was added"
+            $suggestedCommands += "git add $modified"
+        }
+
         $n = $n + 1
     }