Repository navigation
fix(core): prevent Windows template path corruption - #1875
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Critical gaps in the path guard allow symlink/junction aliases and transformed filenames to truncate or overwrite source templates when validation is disabled.
2 open issues
What changed in this PR
This PR addresses #1873 by replacing case-sensitive path substitution in core template processing, preventing Windows drive-letter casing differences from misdirecting generated files.
Changes:
- Discover templates relative to their source directory and construct paths with
path.join(). - Add a guard against overwriting the current source template.
- Add regression tests for special-character paths, collisions, and Windows drive-letter casing.
| File | Description |
|---|---|
spec/unit/Util-spec.ts |
Adds filesystem-based regression tests for template generation and source preservation. |
packages/core/util/Util.ts |
Updates path construction in processing and validation, and adds a source-overwrite guard. |
Review effort: Balanced
dkalinovInfra
previously approved these changes
Nov 5, 2026
kdinev
previously approved these changes
Nov 5, 2026
Contributor
Contributor
Author
|
Thanks. I reproduced the issue on Windows and confirmed that it also exists in the published CLI 15.8.2, so it's not a regression introduced by this PR. I also reproduced it with the current PR changes:
Since it's caused by the same Windows drive-letter casing issue, I'll include the fix and a regression test in this PR as well. |
georgianastasov
dismissed stale reviews from kdinev and dkalinovInfra
via
November 5, 2026 12:57
788b142
kdinev
approved these changes
Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes: #1873
Description
Fix Windows-specific drive-letter casing issues where
globreturns paths starting with an uppercase drive letter (C:/), while the CLI source path may use lowercase (c:/).Case-sensitive path handling could cause:
Changes:
globwithcwdandpath.join()instead of string-based path replacement.ig newand the interactive wizard when template processing fails, avoiding false success messages.path.relative()to handle drive-letter casing correctly.Related Issue
N/A
Type of Change
Affected Packages
igniteui-cli(packages/cli)@igniteui/cli-core(packages/core)@igniteui/angular-templates(packages/igx-templates)@igniteui/angular-schematics(packages/ng-schematics)@igniteui/mcp-server(packages/igniteui-mcp)Checklist
npm run test)npm run build)npm run lint)Additional Context
Verification:
ig new(Angular, jQuery, React, Web Components),ig add, andig generate.