use process.cwd() for correct path

This commit is contained in:
Karsten Hassel
2021-07-13 23:39:55 +02:00
parent 9aa0af4f9c
commit e75e4e2284
43 changed files with 61 additions and 57 deletions

View File

@@ -4,21 +4,24 @@
* MIT Licensed. * MIT Licensed.
*/ */
exports.configFactory = function (options) { exports.configFactory = function (options) {
return Object.assign({ return Object.assign(
port: 8080, {
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], port: 8080,
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"],
language: "en", language: "en",
timeFormat: 24, timeFormat: 24,
units: "metric", units: "metric",
electronOptions: { electronOptions: {
webPreferences: { webPreferences: {
nodeIntegration: true, nodeIntegration: true,
enableRemoteModule: true, enableRemoteModule: true,
contextIsolation: false contextIsolation: false
} }
},
modules: []
}, },
options
modules: [] );
}, options);
}; };

View File

@@ -3,7 +3,7 @@
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("./default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
ipWhitelist: [] ipWhitelist: []
}); });

View File

@@ -3,7 +3,7 @@
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("./default.js").configFactory(); let config = require(process.cwd() + "/tests/configs/default.js").configFactory();
/*************** DO NOT EDIT THE LINE BELOW ***************/ /*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") { if (typeof module !== "undefined") {

View File

@@ -3,7 +3,7 @@
* By rejas * By rejas
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
modules: [ modules: [
{ {
module: "alert", module: "alert",

View File

@@ -3,7 +3,7 @@
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
timeFormat: 12, timeFormat: 12,
modules: [ modules: [

View File

@@ -3,7 +3,7 @@
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
timeFormat: 12, timeFormat: 12,
modules: [ modules: [

View File

@@ -3,7 +3,7 @@
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
timeFormat: 12, timeFormat: 12,
modules: [ modules: [

View File

@@ -3,7 +3,7 @@
* By Rejas * By Rejas
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
timeFormat: 12, timeFormat: 12,
modules: [ modules: [

View File

@@ -3,7 +3,7 @@
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
timeFormat: 12, timeFormat: 12,
modules: [ modules: [

View File

@@ -5,7 +5,7 @@
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
timeFormat: 12, timeFormat: 12,
modules: [ modules: [

View File

@@ -3,7 +3,7 @@
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
timeFormat: 12, timeFormat: 12,
modules: [ modules: [

View File

@@ -3,7 +3,7 @@
* By Rejas * By Rejas
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
timeFormat: 12, timeFormat: 12,
modules: [ modules: [

View File

@@ -3,7 +3,7 @@
* By Sergey Morozov * By Sergey Morozov
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
timeFormat: 12, timeFormat: 12,
modules: [ modules: [

View File

@@ -3,7 +3,7 @@
* By Sergey Morozov * By Sergey Morozov
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
modules: [ modules: [
{ {
module: "clock", module: "clock",

View File

@@ -2,7 +2,7 @@
* *
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
modules: [ modules: [
{ {
module: "clock", module: "clock",

View File

@@ -3,7 +3,7 @@
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
timeFormat: 12, timeFormat: 12,
modules: [ modules: [

View File

@@ -3,7 +3,7 @@
* By Sergey Morozov * By Sergey Morozov
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
timeFormat: 12, timeFormat: 12,
modules: [ modules: [

View File

@@ -3,7 +3,7 @@
* By Johan Hammar * By Johan Hammar
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
timeFormat: 12, timeFormat: 12,
modules: [ modules: [

View File

@@ -3,7 +3,7 @@
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
language: "es", language: "es",
timeFormat: 12, timeFormat: 12,

View File

@@ -3,7 +3,7 @@
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
language: "es", language: "es",
modules: [ modules: [

View File

@@ -3,7 +3,7 @@
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
language: "es", language: "es",
timeFormat: 12, timeFormat: 12,

View File

@@ -4,7 +4,7 @@
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
language: "es", language: "es",
timeFormat: 12, timeFormat: 12,

View File

@@ -3,7 +3,7 @@
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
timeFormat: 12, timeFormat: 12,
modules: [ modules: [

View File

@@ -3,7 +3,7 @@
* By Rejas * By Rejas
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
timeFormat: 12, timeFormat: 12,
modules: [ modules: [

View File

@@ -3,7 +3,7 @@
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
timeFormat: 12, timeFormat: 12,
modules: [ modules: [

View File

@@ -3,7 +3,7 @@
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
timeFormat: 12, timeFormat: 12,
modules: [ modules: [

View File

@@ -3,7 +3,7 @@
* By Rejas * By Rejas
* MIT Licensed. * MIT Licensed.
*/ */
let config = require("../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
modules: [ modules: [
{ {
module: "helloworld", module: "helloworld",

View File

@@ -3,7 +3,7 @@
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
modules: [ modules: [
{ {
module: "helloworld", module: "helloworld",

View File

@@ -3,7 +3,7 @@
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
modules: [ modules: [
{ {
module: "helloworld", module: "helloworld",

View File

@@ -3,7 +3,7 @@
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
timeFormat: 12, timeFormat: 12,
modules: [ modules: [

View File

@@ -2,7 +2,7 @@
* *
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
timeFormat: 12, timeFormat: 12,
modules: [ modules: [

View File

@@ -2,7 +2,7 @@
* *
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
timeFormat: 12, timeFormat: 12,
modules: [ modules: [

View File

@@ -3,7 +3,7 @@
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
modules: modules:
// Using exotic content. This is why don't accept go to JSON configuration file // Using exotic content. This is why don't accept go to JSON configuration file
(function () { (function () {

View File

@@ -3,7 +3,7 @@
* By rejas https://github.com/rejas * By rejas https://github.com/rejas
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
modules: [ modules: [
{ {
module: "compliments", module: "compliments",

View File

@@ -3,7 +3,7 @@
* By fewieden https://github.com/fewieden * By fewieden https://github.com/fewieden
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
timeFormat: 12, timeFormat: 12,
modules: [ modules: [

View File

@@ -3,7 +3,7 @@
* By fewieden https://github.com/fewieden * By fewieden https://github.com/fewieden
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
modules: [ modules: [
{ {
module: "weather", module: "weather",

View File

@@ -3,7 +3,7 @@
* By fewieden https://github.com/fewieden * By fewieden https://github.com/fewieden
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
units: "imperial", units: "imperial",
modules: [ modules: [

View File

@@ -3,7 +3,7 @@
* By fewieden https://github.com/fewieden * By fewieden https://github.com/fewieden
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
timeFormat: 12, timeFormat: 12,
modules: [ modules: [

View File

@@ -3,7 +3,7 @@
* By fewieden https://github.com/fewieden * By fewieden https://github.com/fewieden
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
timeFormat: 12, timeFormat: 12,
modules: [ modules: [

View File

@@ -3,7 +3,7 @@
* By rejas * By rejas
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("../../default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
units: "imperial", units: "imperial",
modules: [ modules: [

View File

@@ -3,7 +3,7 @@
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("./default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
ipWhitelist: ["x.x.x.x"] ipWhitelist: ["x.x.x.x"]
}); });

View File

@@ -3,7 +3,7 @@
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("./default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
port: 8090 port: 8090
}); });

View File

@@ -3,9 +3,10 @@
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
* MIT Licensed. * MIT Licensed.
*/ */
const config = require("./default.js").configFactory({ let config = require(process.cwd() + "/tests/configs/default.js").configFactory({
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.10.1"] ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.10.1"]
}); });
delete config.modules;
/*************** DO NOT EDIT THE LINE BELOW ***************/ /*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") { if (typeof module !== "undefined") {