Removed gulp `premerge` task (#2357)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
diff --git a/.travis.yml b/.travis.yml
index 4cbb749..1023859 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,9 +13,12 @@ before_install:
install:
- npm ci
before_script:
-- npm install -g gulp
-- gulp
-- gulp premerge
+# Rebuild Prism
+- npx gulp
+# Detect changes
+# First, we stage all changes and then detect if there is anything staged
+- git add --all && git diff-index --cached HEAD --stat --exit-code ||
+ (echo && echo "The above files changed because the build is not up to date." && echo "Please rebuild Prism." && exit 1)
script: npm test
deploy:
provider: npm
diff --git a/gulpfile.js/index.js b/gulpfile.js/index.js
index ae3e0d0..ece403a 100644
--- a/gulpfile.js/index.js
+++ b/gulpfile.js/index.js
@@ -12,7 +12,6 @@ const util = require('util');
const fs = require('fs');
const paths = require('./paths');
-const { premerge } = require('./premerge');
const { changes, linkify } = require('./changelog');
@@ -216,7 +215,6 @@ const plugins = series(languagePlugins, minifyPlugins);
module.exports = {
watch: watchComponentsAndPlugins,
default: parallel(components, plugins, componentsJsonToJs, build),
- premerge,
linkify,
changes
};
diff --git a/gulpfile.js/premerge.js b/gulpfile.js/premerge.js
deleted file mode 100644
index c83894b..0000000
--- a/gulpfile.js/premerge.js
+++ /dev/null
@@ -1,20 +0,0 @@
-"use strict";
-
-const git = require('simple-git/promise')(__dirname);
-
-
-/**
- * Checks that no files have been modified by the build process.
- */
-function gitChanges() {
- return git.status().then(res => {
- if (res.files.length > 0) {
- console.log(res);
- throw new Error('There are changes in the file system. Did you forget to run gulp?');
- }
- });
-}
-
-module.exports = {
- premerge: gitChanges
-};