From 0ed77732239f7a3b9242df41d41b6c63a935c10c Mon Sep 17 00:00:00 2001 From: Florian Knop Date: Wed, 6 Jul 2016 05:52:35 +0200 Subject: [PATCH] build(gulp): Fix paths for public-api tasks on Windows (#9794) --- gulpfile.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 6aad26daed..ef9158d678 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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)); });