Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Commit 01f3af7

Browse files
dhergeshansl
authored andcommitted
fix(@schematics/angular): ensure forward slashes in library command
1 parent 36a56b7 commit 01f3af7

File tree

1 file changed

+8
-2
lines changed
  • packages/schematics/angular/library

1 file changed

+8
-2
lines changed

packages/schematics/angular/library/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ import {
2323
import * as path from 'path';
2424
import { Schema as GenerateLibraryOptions } from './schema';
2525

26+
function forwardSlashes(value: string): string {
27+
return value.replace(/\\/g, '/');
28+
}
29+
2630
type PackageJsonPartialType = {
2731
scripts: {
2832
[key: string]: string;
@@ -134,8 +138,10 @@ export default function (options: GenerateLibraryOptions): Rule {
134138
branchAndMerge(chain([
135139
mergeWith(templateSource),
136140
])),
137-
options.skipPackageJson ? noop() : addDependenciesAndScriptsToPackageJson(name, sourceDir),
138-
options.skipTsConfig ? noop() : updateTsConfig(name, entryFilePath),
141+
options.skipPackageJson ? noop() : addDependenciesAndScriptsToPackageJson(name,
142+
forwardSlashes(sourceDir)),
143+
options.skipTsConfig ? noop() : updateTsConfig(name,
144+
forwardSlashes(entryFilePath)),
139145
])(host, context);
140146
};
141147
}

0 commit comments

Comments
 (0)