1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- // Import Dependencies.
- var gulp = require("gulp");
- var fs = require("fs");
- /**
- * Tests the whats new file to ensure changes have been made in the PR.
- */
- gulp.task("tests-whatsnew", function(done) {
- // // Only checks on Travis
- // if (!process.env.TRAVIS) {
- // done();
- // return;
- // }
- // // Only checks on Pull Requests
- // if (process.env.TRAVIS_PULL_REQUEST == "false") {
- // done();
- // return;
- // }
- // // Do not check deploy
- // if (process.env.TRAVIS_BRANCH == "preview") {
- // done();
- // return;
- // }
- // Compare what's new with the current one in the preview release folder.
- const https = require("https");
- const url = "https://rawgit.com/BabylonJS/Babylon.js/master/dist/preview%20release/what's%20new.md";
- https.get(url, res => {
- res.setEncoding("utf8");
- let oldData = "";
- res.on("data", data => {
- oldData += data;
- });
- res.on("end", () => {
- fs.readFile("../../dist/preview release/what's new.md", "utf-8", function(err, newData) {
-
- console.log(newData)
- if (err || oldData != newData) {
- done();
- return;
- }
- console.error("What's new file did not change.");
- process.exit(1);
- });
- });
- });
- });
|