-
Notifications
You must be signed in to change notification settings - Fork 165
refactor: cross-platform build script compatibility (CUT-5128) #741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v3.1.1_pwshModule
Are you sure you want to change the base?
Changes from all commits
1ab3f92
6048ec3
041f83d
f3c9ff8
f46c9c2
6e2d98d
ad11d9a
c300f2e
09969ab
515b9b6
dd644ca
1e4ba3b
79d729a
07d64af
3cad7fd
fe6a33d
2de6998
afc94a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,7 @@ Function Global:Invoke-GitCommit { | |
| Invoke-Git -Arguments:('add -A;') | ||
| Invoke-Git -Arguments:('status;') | ||
| Invoke-Git -Arguments:('remote;') | ||
| Invoke-Git -Arguments:('commit -m ' + '"' + $CommitMessage + '";') | ||
| Invoke-Git -Arguments:('push origin ' + 'master' + ';') | ||
| #Invoke-Git -Arguments:('commit -m ' + '"' + $CommitMessage + '";') | ||
| #Invoke-Git -Arguments:('push origin ' + 'master' + ';') | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Git commit and push permanently disabled in buildMedium Severity Both Reviewed by Cursor Bugbot for commit 6048ec3. Configure here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| Execution Commands | ||
| Run the build script from the root of the repository using pwsh to generate a new version (Patch, Minor, or Major): | ||
|
|
||
| On Windows: | ||
|
|
||
| PowerShell | ||
| pwsh ./PowerShell/Deploy/Build-Module.ps1 -ReleaseType Patch | ||
| On macOS / Linux: | ||
|
|
||
| Bash | ||
| pwsh ./PowerShell/Deploy/Build-Module.ps1 -ReleaseType Patch | ||
| 🛠️ Script Architecture | ||
| Get-Config.ps1: The configuration engine. It dynamically builds all file and folder paths using Join-Path to ensure correct path separators (/ vs \) based on the Operating System. | ||
|
|
||
| Build-Module.ps1: The orchestrator. It manages the build workflow, updates the module manifest (.psd1), and handles the changelog. | ||
|
|
||
| Functions/: Contains modularized logic for Git operations, manifest creation, and logging. | ||
|
|
||
| Cross-Platform Compatibility | ||
| The build system has been modernized to eliminate hardcoded path strings: | ||
|
|
||
| Windows (PS 5.1 & 7): Paths resolve using backslashes (e.g., C:\\Workspace\\...). | ||
|
|
||
| macOS / Linux: Paths resolve using forward slashes (e.g., /Users/name/...). | ||
|
|
||
| Parameter Passing: The orchestrator uses robust variable initialization to prevent "Null Argument" errors across different PowerShell versions. | ||
|
|
||
| Safety Note (ATENTION) | ||
| The Invoke-GitCommit.ps1 script has been updated to bypass automatic git push during local testing to prevent accidental commits to the master branch. |


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set-Location not restored if help script throws
Low Severity
The working directory is changed via
Set-Locationbefore calling& $BuildHelpPath, and restored afterward on line 90. If the help script throws a terminating error,Set-Location -Path $PreviousLocationis skipped, leaving the process in the "Docs" directory. Subsequent operations likeBuild-PesterTestFiles.ps1would then execute from an unexpected location. Atry/finallyblock would ensure the location is always restored.Reviewed by Cursor Bugbot for commit 07d64af. Configure here.