build(gulp): Fix paths for public-api tasks on Windows (#9794)

This commit is contained in:
Florian Knop 2016-07-06 05:52:35 +02:00 committed by Victor Berchet
parent 3f55aa609f
commit 0ed7773223
1 changed files with 3 additions and 3 deletions

View File

@ -49,7 +49,7 @@ const entrypoints = [
'dist/packages-dist/forms/index.d.ts',
'dist/packages-dist/router/index.d.ts'
];
const publicApiDir = 'tools/public_api_guard';
const publicApiDir = path.normalize('tools/public_api_guard');
const publicApiArgs = [
'--rootDir', 'dist/packages-dist',
'--stripExportPattern', '^__',
@ -64,7 +64,7 @@ gulp.task('public-api:enforce', (done) => {
const child_process = require('child_process');
child_process
.spawn(
`${__dirname}/node_modules/.bin/ts-api-guardian`,
path.join(__dirname, `/node_modules/.bin/ts-api-guardian${/^win/.test(os.platform()) ? '.cmd' : ''}`),
['--verifyDir', publicApiDir].concat(publicApiArgs), {stdio: 'inherit'})
.on('close', (errorCode) => {
if (errorCode !== 0) {
@ -80,7 +80,7 @@ gulp.task('public-api:update', (done) => {
const child_process = require('child_process');
child_process
.spawn(
`${__dirname}/node_modules/.bin/ts-api-guardian`,
path.join(__dirname, `/node_modules/.bin/ts-api-guardian${/^win/.test(os.platform()) ? '.cmd' : ''}`),
['--outDir', publicApiDir].concat(publicApiArgs), {stdio: 'inherit'})
.on('close', (errorCode) => done(errorCode));
});