From ea0b643f5b4248348e6456308803911679e19c66 Mon Sep 17 00:00:00 2001 From: Louis Eveillard Date: Wed, 15 Jan 2020 17:26:23 +0100 Subject: [PATCH] testing with global var --- src/core/exporter.js | 4 ++-- src/index.js | 22 ++++++++++++---------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/core/exporter.js b/src/core/exporter.js index a404fb032..7c7f456e5 100644 --- a/src/core/exporter.js +++ b/src/core/exporter.js @@ -11,8 +11,8 @@ const dev = require("./dev-log"), file = require("./file"), thumbs = require("./thumbs"); -ffmpeg.setFfmpegPath("../ffmpeg-4.1.3-armhf-static/ffmpeg"); -ffmpeg.setFfprobePath("./ffmpeg-4.1.3-armhf-static/ffprobe"); +ffmpeg.setFfmpegPath(path.join(global.ffmpegpath, "ffmpeg")); +ffmpeg.setFfprobePath(path.join(global.ffmpegpath, "ffprobe")); const renice = 0; diff --git a/src/index.js b/src/index.js index abcb9fb97..b2fed92ef 100644 --- a/src/index.js +++ b/src/index.js @@ -1,10 +1,10 @@ -const path = require('path'); -const packagejson = require('../package.json'); -const base_settings = require('../settings_base.json'); +const path = require("path"); +const packagejson = require("../package.json"); +const base_settings = require("../settings_base.json"); -global.appRoot = path.resolve(__dirname, '..'); +global.appRoot = path.resolve(__dirname, ".."); -console.log('approot : ' + global.appRoot); +console.log("approot : " + global.appRoot); global.appInfos = { name: packagejson.name, @@ -14,16 +14,18 @@ global.appInfos = { let settings = base_settings; try { - const override_settings = require('../settings.json'); + const override_settings = require("../settings.json"); Object.assign(settings, override_settings); - console.log('INDEX / found override settings.json'); + console.log("INDEX / found override settings.json"); } catch (ex) { - console.log('INDEX / didn’t find override settings'); + console.log("INDEX / didn’t find override settings"); } global.settings = settings; -const router = require('./router'); +global.ffmpegpath = path.join(global.appRoot, "ffmpeg-4.1.3-armhf-static"); -require('./core/main')({ +const router = require("./router"); + +require("./core/main")({ router });