build(gulp): Fix paths for public-api tasks on Windows (#9794)
This commit is contained in:
parent
3f55aa609f
commit
0ed7773223
@ -49,7 +49,7 @@ const entrypoints = [
|
|||||||
'dist/packages-dist/forms/index.d.ts',
|
'dist/packages-dist/forms/index.d.ts',
|
||||||
'dist/packages-dist/router/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 = [
|
const publicApiArgs = [
|
||||||
'--rootDir', 'dist/packages-dist',
|
'--rootDir', 'dist/packages-dist',
|
||||||
'--stripExportPattern', '^__',
|
'--stripExportPattern', '^__',
|
||||||
@ -64,7 +64,7 @@ gulp.task('public-api:enforce', (done) => {
|
|||||||
const child_process = require('child_process');
|
const child_process = require('child_process');
|
||||||
child_process
|
child_process
|
||||||
.spawn(
|
.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'})
|
['--verifyDir', publicApiDir].concat(publicApiArgs), {stdio: 'inherit'})
|
||||||
.on('close', (errorCode) => {
|
.on('close', (errorCode) => {
|
||||||
if (errorCode !== 0) {
|
if (errorCode !== 0) {
|
||||||
@ -80,7 +80,7 @@ gulp.task('public-api:update', (done) => {
|
|||||||
const child_process = require('child_process');
|
const child_process = require('child_process');
|
||||||
child_process
|
child_process
|
||||||
.spawn(
|
.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'})
|
['--outDir', publicApiDir].concat(publicApiArgs), {stdio: 'inherit'})
|
||||||
.on('close', (errorCode) => done(errorCode));
|
.on('close', (errorCode) => done(errorCode));
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user