diff --git a/gulpfile.js b/gulpfile.js index 4a4707bf4bc..e61c9f03782 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -6,9 +6,16 @@ const path = require('path'); -const tsconfigPath = path.join(__dirname, 'tools/gulp/tsconfig.json'); +const projectDir = __dirname; +const tsconfigPath = path.join(projectDir, 'tools/gulp/tsconfig.json'); const tsconfig = require(tsconfigPath); +if (projectDir.includes(' ')) { + console.error('Error: Cannot run the Angular Material build tasks if the project is ' + + 'located in a directory with spaces in between. Please rename your project directory.'); + process.exit(1); +} + // Register TS compilation. require('ts-node').register({ project: tsconfigPath