NVRAppDevOps icon indicating copy to clipboard operation
NVRAppDevOps copied to clipboard

Invoke-PaketForAL - UsePackagesAsCache settings.json UTF encoding bug

Open JeremyVyska opened this issue 8 months ago • 1 comments

I have a multiroot workspace with folders:

  • _Symbols
  • App
  • Test

The root contains a workspace file that has a "al.packageCachePath": "../_Symbols", setting, but this option requires that setting to be in the settings.json of the app, which is fine.

So, I update my App.vscode\settings.json to contain:

{
    "CRS.ObjectNamePrefix": "ZZZ",
    "al.codeAnalyzers": [
        "${CodeCop}",
        "${UICop}",
        "${AppSourceCop}",
        "${analyzerFolder}BusinessCentral.LinterCop.dll"
    ],
    "al.ruleSetPath": "../_ALRulesets/BrightCom-App.ruleset.json",
    "al.packageCachePath": [
        "../_Symbols"
    ]
}

When I run Invoke-PaketForAL -UsePackagesAsCache from the \App folder:

What I would expect Packages would populate into the shared symbols folder

What happens It does not use the .vscode\settings.json file. It downloads them to the App\packages folder.

However, it also shreds my settings.json. It APPEARS to:

  • re-saves the settings.json in UTF16 LE(BOM) instead of leaving it UTF8
  • just adds the "packages" to the array:
    "al.packageCachePath":  [
                                "../_Symbols",
                                "packages"
                            ]

So, reading the help, I saw that I was thinking wrong reading this flag as "using the existing", when it makes the packages the shared path. Little puzzling.

The encoding issue is the real "bug" in this case, I think.

A nice "related" feature would be to be allowed to choose the destination folder for your packages, but that's less urgent, I think.

JeremyVyska avatar May 08 '25 08:05 JeremyVyska