Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis: Fail when changed files are detected #1819

Merged
merged 11 commits into from
Mar 24, 2019
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ branches:
only:
- gh-pages
- /.*/
before_install:
- npm i -g npm@latest
install:
- npm ci
before_script:
- npm install -g gulp
- gulp
- gulp premerge
script: npm test
deploy:
provider: npm
Expand Down
2 changes: 1 addition & 1 deletion components/prism-markdown.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const concat = require('gulp-concat');
const replace = require('gulp-replace');
const pump = require('pump');
const fs = require('fs');
const simpleGit = require('simple-git');

const paths = {
componentsFile: 'components.json',
Expand Down Expand Up @@ -202,7 +203,24 @@ function changelog(cb) {
const components = minifyComponents;
const plugins = series(languagePlugins, minifyPlugins);

function gitChanges(cb) {
const git = simpleGit(__dirname);

git.status((err, res) => {
if (err) {
cb(new Error(`Something went wrong!\n${err}`));
} else if (res.files.length > 0) {
console.log(res);
cb(new Error('There are changes in the file system. Did you forget to run gulp?'));
} else {
cb();
}
});
}


exports.watch = watchComponentsAndPlugins;
exports.default = parallel(components, plugins, componentsJsonToJs, build);
exports.changelog = changelog;

exports.premerge = gitChanges;
Loading