Skip to content

Commit

Permalink
testing with global var
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-ev committed Jan 15, 2020
1 parent 96e770f commit ea0b643
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/core/exporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
22 changes: 12 additions & 10 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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
});

0 comments on commit ea0b643

Please sign in to comment.