From 2313c3e4fca74da03fc3137564f19b7c735565a5 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Wed, 3 Jan 2018 16:21:08 +0200 Subject: [PATCH] Added travis checking --- scripts/tdd.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/tdd.js b/scripts/tdd.js index e9333dc3b..92cadd062 100644 --- a/scripts/tdd.js +++ b/scripts/tdd.js @@ -5,7 +5,13 @@ // Load modules const fs = require('fs-extra'); - +const chalk = require('chalk'); +// Load helper functions (these are from existing snippets in 30 seconds of code!) +const isTravisCI = () => 'TRAVIS' in process.env && 'CI' in process.env; +if(isTravisCI() && process.env['TRAVIS_EVENT_TYPE'] !== 'cron' && process.env['TRAVIS_EVENT_TYPE'] !== 'api') { + console.log(`${chalk.green('NOBUILD')} Testing terminated, not a cron job or a custom build!`); + process.exit(0); +} // Declare paths const SNIPPETS_PATH = './snippets'; const TEST_PATH = './test'; @@ -75,4 +81,4 @@ snippetFiles // return fileName for later use return fileName; }); - \ No newline at end of file +