-
Notifications
You must be signed in to change notification settings - Fork 125
Closed
Labels
bugSomething isn't workingSomething isn't workingneeds-triageRequires triage and prioritizationRequires triage and prioritization
Description
Description
Running npm run lint:ps (or npm run lint:all) in a fresh devcontainer or clone fails with:
Write-Error: PSScriptAnalyzer failed: Could not find a part of the path '/workspaces/hve-core/logs/psscriptanalyzer-results.json'.
Root Cause
Invoke-PSScriptAnalyzer.ps1 writes results to logs/psscriptanalyzer-results.json and logs/psscriptanalyzer-summary.json, but never ensures the logs/ directory exists before writing. The logs/ directory is gitignored, so it is not present after a fresh clone or codespace creation.
Neither the devcontainer lifecycle scripts (on-create.sh, post-create.sh) nor the linting script itself create the directory.
Reproduction
- Open hve-core in a fresh codespace or devcontainer
- Run
npm run lint:ps - Observe the path error
Suggested Fix
Either:
- In
Invoke-PSScriptAnalyzer.ps1: AddNew-Item -ItemType Directory -Force -Path (Split-Path $OutputPath)before writing results (defensive, self-contained fix). - In
post-create.sh: Addmkdir -p logsso the directory exists after container setup. - Both: Apply option 1 for robustness and option 2 for consistency.
Workaround
mkdir -p logsAffected Scripts
scripts/linting/Invoke-PSScriptAnalyzer.ps1(lines 123-124)
Environment
- DevContainer on Ubuntu 24.04
- PowerShell 7.5.4
- Node.js 24.x
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingneeds-triageRequires triage and prioritizationRequires triage and prioritization