Skip to content

correction sub-component path in windows when import to ngModule #1719 #1736 #1961

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

Merged
merged 5 commits into from
Sep 19, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/ast-tools/src/route-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export function bootstrapItem(

export function insertImport(fileToEdit: string, symbolName: string,
fileName: string, isDefault = false): Change {
fileName = fileName.replace(/\\/, '/'); // correction in windows
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, could you do a typescript if (process.platform.startsWith('win')) { fileName = fileName.replace(/\\/g, '/'); }

This will also fix the bug that it only replaces the first time this character appears.

let rootNode = getRootNode(fileToEdit);
let allImports = findNodes(rootNode, ts.SyntaxKind.ImportDeclaration);

Expand Down