Minor fixes.

This commit is contained in:
Michael Teeuw
2018-01-25 20:07:51 +01:00
parent 29fc7910b7
commit e2dbe8a0a2
3 changed files with 49 additions and 39 deletions

View File

@@ -12,5 +12,11 @@
"browser": true, "browser": true,
"node": true, "node": true,
"es6": true "es6": true
},
"parserOptions": {
"sourceType": "module",
"ecmaFeatures": {
"globalReturn": true
}
} }
} }

View File

@@ -1,9 +1,9 @@
import { danger, fail } from 'danger' import { danger, fail } from "danger"
// Check if the CHANGELOG.md file has been edited // Check if the CHANGELOG.md file has been edited
const changelogEdited = danger.git.modified_files.includes('CHANGELOG.md') const changelogEdited = danger.git.modified_files.includes("CHANGELOG.md")
// Fail the build and post a comment reminding submitters to do so if it wasn't changed // Fail the build and post a comment reminding submitters to do so if it wasn't changed
if (!changelogEdited) { if (!changelogEdited) {
fail('Please include a CHANGELOG entry. You can find it at [CHANGELOG.md](CHANGELOG.md).') fail("Please include a CHANGELOG entry. You can find it at [CHANGELOG.md](CHANGELOG.md).")
} }

View File

@@ -14,8 +14,6 @@ var path = require("path");
var fs = require("fs"); var fs = require("fs");
var Utils = require(__dirname + "/../../js/utils.js"); var Utils = require(__dirname + "/../../js/utils.js");
if (process.env.NODE_ENV == "test") { return 0 };
/* getConfigFile() /* getConfigFile()
* Return string with path of configuration file * Return string with path of configuration file
* Check if set by enviroment variable MM_CONFIG_FILE * Check if set by enviroment variable MM_CONFIG_FILE
@@ -30,6 +28,7 @@ function getConfigFile() {
return configFileName; return configFileName;
} }
function checkConfigFile() {
var configFileName = getConfigFile(); var configFileName = getConfigFile();
// Check if file is present // Check if file is present
if (fs.existsSync(configFileName) === false) { if (fs.existsSync(configFileName) === false) {
@@ -64,3 +63,8 @@ fs.readFile(configFileName, "utf-8", function (err, data) {
} }
} }
}); });
}
if (process.env.NODE_ENV !== "test") {
checkConfigFile();
};