winutil icon indicating copy to clipboard operation
winutil copied to clipboard

`devdocs-generator.ps1` is Currently Broken

Open og-mrk opened this issue 10 months ago • 1 comments

⚙️ Issue Checklist

  • [x] I have read the guidelines.
  • [x] I checked for duplicate issues.
  • [x] I searched for existing discussions.
  • [x] I checked for an existing pull request that addresses this issue.

📜 What part of Winutil are you having issues with?

dev tools

📝 Provide a clear and concise description of the issue.

Currently the devdocs generator doesn't work as the overall project code (and to a certain extent, its structure) has changed, which this tool (devdocs-generator) fails to acknowledge these changes, leading to multiple failures when executing devdocs-generator.ps1 script.

🔄 Steps to reproduce the issue.

run .\tools\devdocs-generator.ps1 inside project root folder.

❌ Paste the full error output (if available).

[!NOTE] D:\development\others_repos\winutil is winutil clone on my hard drive, this will most likely be of different value when reproducing the error(s)

Get-Content: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:566
Line |
 566 |  $tweaks = Get-Content -Path "../config/tweaks.json" | ConvertFrom-Jso …
     |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot find path 'D:\development\others_repos\config\tweaks.json' because it does not exist.
Get-Content: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:567
Line |
 567 |  $features = Get-Content -Path "../config/feature.json" | ConvertFrom- …
     |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot find path 'D:\development\others_repos\config\feature.json' because it does not exist.
Get-Item: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:570
Line |
 570 |  $tweaksLastModified = (Get-Item "../config/tweaks.json").LastWriteTim …
     |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot find path 'D:\development\others_repos\config\tweaks.json' because it does not exist.
InvalidOperation: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:570
Line |
 570 |  $tweaksLastModified = (Get-Item "../config/tweaks.json").LastWriteTim …
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.
Get-Item: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:571
Line |
 571 |  $featuresLastModified = (Get-Item "../config/feature.json").LastWrite …
     |                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot find path 'D:\development\others_repos\config\feature.json' because it does not exist.
InvalidOperation: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:571
Line |
 571 |  $featuresLastModified = (Get-Item "../config/feature.json").LastWrite …
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.
Get-ChildItem: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:54
Line |
  54 |      Get-ChildItem -Path $dir -Filter *.ps1 | ForEach-Object {
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot find path 'D:\development\others_repos\functions\private' because it does not exist.
Get-ChildItem: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:54
Line |
  54 |      Get-ChildItem -Path $dir -Filter *.ps1 | ForEach-Object {
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot find path 'D:\development\others_repos\functions\public' because it does not exist.
Get-Content: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:600
Line |
 600 |      $json = Get-Content -Raw -Path $jsonPath | ConvertFrom-Json
     |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot find path 'D:\development\others_repos\config\feature.json' because it does not exist.
Add-LinkAttribute: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:606
Line |
 606 |      Add-LinkAttribute -jsonObject $json
     |                                    ~~~~~
     | Cannot bind argument to parameter 'jsonObject' because it is null.
InvalidOperation: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:609
Line |
 609 |      $jsonString = ($json | ConvertTo-Json -Depth 100).replace('\n',"` …
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.
Set-Content: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:612
Line |
 612 |      Set-Content -Path $jsonPath -Value $jsonString
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Could not find a part of the path 'D:\development\others_repos\config\feature.json'.
Get-Content: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:600
Line |
 600 |      $json = Get-Content -Raw -Path $jsonPath | ConvertFrom-Json
     |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot find path 'D:\development\others_repos\config\tweaks.json' because it does not exist.
Add-LinkAttribute: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:606
Line |
 606 |      Add-LinkAttribute -jsonObject $json
     |                                    ~~~~~
     | Cannot bind argument to parameter 'jsonObject' because it is null.
InvalidOperation: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:609
Line |
 609 |      $jsonString = ($json | ConvertTo-Json -Depth 100).replace('\n',"` …
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.
Set-Content: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:612
Line |
 612 |      Set-Content -Path $jsonPath -Value $jsonString
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Could not find a part of the path 'D:\development\others_repos\config\tweaks.json'.
Get-Content: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:540
Line |
 540 |      $jsonText = Get-Content -Path $jsonFilePath -Raw
     |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot find path 'D:\development\others_repos\config\tweaks.json' because it does not exist.
RuntimeException: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:544
Line |
 544 |      $progressIncrement = 20 / $totalItems
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Attempted to divide by zero.
InvalidOperation: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:561
Line |
 561 |      $jsonText = ($jsonData | ConvertTo-Json -Depth 10).replace('\n'," …
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.
Set-Content: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:562
Line |
 562 |      Set-Content -Path $jsonFilePath -Value ($jsonText) -Encoding utf8
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Could not find a part of the path 'D:\development\others_repos\config\tweaks.json'.
Get-Content: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:540
Line |
 540 |      $jsonText = Get-Content -Path $jsonFilePath -Raw
     |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot find path 'D:\development\others_repos\config\feature.json' because it does not exist.
RuntimeException: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:544
Line |
 544 |      $progressIncrement = 20 / $totalItems
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Attempted to divide by zero.
InvalidOperation: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:561
Line |
 561 |      $jsonText = ($jsonData | ConvertTo-Json -Depth 10).replace('\n'," …
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.
Set-Content: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:562
Line |
 562 |      Set-Content -Path $jsonFilePath -Value ($jsonText) -Encoding utf8
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Could not find a part of the path 'D:\development\others_repos\config\feature.json'.
Generate-MarkdownFiles: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:619
Line |
 619 |  $tweakResult = Generate-MarkdownFiles -data $tweaks -outputDir $tweak …
     |                                              ~~~~~~~
     | Cannot bind argument to parameter 'data' because it is null.
Generate-MarkdownFiles: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:620
Line |
 620 |  $featureResult = Generate-MarkdownFiles -data $features -outputDir $f …
     |                                                ~~~~~~~~~
     | Cannot bind argument to parameter 'data' because it is null.
RuntimeException: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:510
Line |
 510 |      $progressIncrement = 10 / $totalEntries
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Attempted to divide by zero.
RuntimeException: D:\development\others_repos\winutil\tools\devdocs-generator.ps1:510
Line |
 510 |      $progressIncrement = 10 / $totalEntries
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Attempted to divide by zero.

🖼️ Additional context.

I remember having a discussion about this with @MyDrift-user, and I don't think making this script working is all that important, as there's future plans about moving all the docs to a separate repo. May be my memory is faulty, as it's been a few months now, but take this info a grain of salt 🧂. But generally speaking, if the tool works, then it'll be less hassle when actually making the move.

og-mrk avatar Mar 05 '25 10:03 og-mrk

Yeah I think separating docs to a separate repo just makes everything harder to maintain.

ChrisTitusTech avatar Mar 19 '25 22:03 ChrisTitusTech

This issue was marked as stale due to inactivity.

github-actions[bot] avatar Jun 18 '25 00:06 github-actions[bot]