Added travis checking

This commit is contained in:
Angelos Chalaris
2018-01-03 16:21:08 +02:00
committed by GitHub
parent 087fc564ab
commit 2313c3e4fc

View File

@ -5,7 +5,13 @@
// Load modules // Load modules
const fs = require('fs-extra'); 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 // Declare paths
const SNIPPETS_PATH = './snippets'; const SNIPPETS_PATH = './snippets';
const TEST_PATH = './test'; const TEST_PATH = './test';