Skip to content

Commit bfec2b4

Browse files
committed
fix: postinstall handling for windows
1 parent 838401c commit bfec2b4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/nx/src/schematics/application/application.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ function addAppFiles(options: Schema, appName: string, extra: string = ''): Rule
143143
appname,
144144
directoryAppPath: `${directory}${options.name}`,
145145
pathOffset: directory ? '../../../' : '../../',
146-
pathOffsetWindows: directory ? '..\\..\\..\\' : '..\\..\\',
147146
libFolderName: PluginHelpers.getLibFoldername('nativescript'),
148147
angularVersion,
149148
nsAngularVersion,

packages/nx/src/schematics/application/files_angular/tools/postinstall.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ try {
1515
}
1616

1717
// Helpful to trigger ngcc after an install to ensure all has processed properly
18-
const child = childProcess.spawn(/^win/.test(process.platform) ? '<%= pathOffsetWindows %>node_modules\\.bin\\ngcc' : '<%= pathOffset %>node_modules/.bin/ngcc', ['--tsconfig', 'tsconfig.app.json', '--properties', 'es2015', 'module', 'main', '--first-only'], {
18+
const relativePath = '<%= pathOffset %>'.split('/').filter(p => !!p);
19+
const ngccPath = path.join(...relativePath, 'node_modules', '.bin', 'ngcc');
20+
const child = childProcess.spawn(ngccPath, ['--tsconfig', 'tsconfig.app.json', '--properties', 'es2015', 'module', 'main', '--first-only'], {
1921
cwd: process.cwd(),
2022
stdio: 'inherit',
23+
shell: process.platform == 'win32'
2124
});
2225
child.on('close', (code) => {
2326

0 commit comments

Comments
 (0)