mirror of
https://github.com/stagehacks/Cue-View.git
synced 2026-08-05 22:03:41 +00:00
correct a ton of path syntax
This commit is contained in:
+2
-1
@@ -1,5 +1,6 @@
|
||||
const _ = require('lodash');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
exports.defaultName = 'ETC Eos';
|
||||
exports.connectionType = 'osc';
|
||||
@@ -132,7 +133,7 @@ exports.data = function data(device, osc) {
|
||||
};
|
||||
|
||||
|
||||
const cueTemplate = _.template(fs.readFileSync(`./plugins/eos/cue.ejs`));
|
||||
const cueTemplate = _.template(fs.readFileSync(path.join(__dirname, `cue.ejs`)));
|
||||
|
||||
exports.update = function update(device, doc, updateType, data){
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
|
||||
<%
|
||||
const fs = require('fs');
|
||||
let cueTemplate = _.template(fs.readFileSync(`./plugins/eos/cue.ejs`));
|
||||
const path = require('path');
|
||||
let cueTemplate = _.template(fs.readFileSync(path.join(__dirname, `/plugins/eos/cue.ejs`)));
|
||||
%>
|
||||
|
||||
|
||||
|
||||
@@ -5,19 +5,19 @@
|
||||
|
||||
<td><center>
|
||||
<% if(cue.broken){ %>
|
||||
<img src="plugins/qlab/img/status_broken.png" height="18px">
|
||||
<img src="./plugins/qlab/img/status_broken.png" height="18px">
|
||||
|
||||
<% }else if(cue.running){ %>
|
||||
<img src="plugins/qlab/img/status_running.png" height="18px">
|
||||
<img src="./plugins/qlab/img/status_running.png" height="18px">
|
||||
|
||||
<% }else if(cue.paused){ %>
|
||||
<img src="plugins/qlab/img/status_paused.png" height="18px">
|
||||
<img src="./plugins/qlab/img/status_paused.png" height="18px">
|
||||
|
||||
<% }else if(cue.loaded){ %>
|
||||
<img src="plugins/qlab/img/status_loaded.png" height="18px">
|
||||
<img src="./plugins/qlab/img/status_loaded.png" height="18px">
|
||||
|
||||
<% }else if(cue.flagged){ %>
|
||||
<img src="plugins/qlab/img/status_flagged.png" height="20px">
|
||||
<img src="./plugins/qlab/img/status_flagged.png" height="20px">
|
||||
|
||||
<% }else{ %>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
</center></td>
|
||||
|
||||
|
||||
<td><img src="plugins/qlab/img/<%= cue.type.toLowerCase().replace(' ','-') %>.png" height="20px"></td>
|
||||
<td><img src="./plugins/qlab/img/<%= cue.type.toLowerCase().replace(' ','-') %>.png" height="20px"></td>
|
||||
<td><center><%= cue.number || " " %></center></td>
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const _ = require('lodash');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
let lastElapsedUpdate = Date.now();
|
||||
|
||||
@@ -267,9 +268,9 @@ exports.data = function data(device, oscData) {
|
||||
};
|
||||
|
||||
|
||||
const cueTemplate = _.template(fs.readFileSync(`./plugins/qlab/cue.ejs`));
|
||||
const tileTemplate = _.template(fs.readFileSync(`./plugins/qlab/tile.ejs`));
|
||||
const cartTemplate = _.template(fs.readFileSync(`./plugins/qlab/cart.ejs`));
|
||||
const cueTemplate = _.template(fs.readFileSync(path.join(__dirname, `cue.ejs`)));
|
||||
const tileTemplate = _.template(fs.readFileSync(path.join(__dirname, `tile.ejs`)));
|
||||
const cartTemplate = _.template(fs.readFileSync(path.join(__dirname, `cart.ejs`)));
|
||||
|
||||
exports.update = function update(device, doc, updateType, data){
|
||||
|
||||
|
||||
@@ -6,11 +6,12 @@
|
||||
<%
|
||||
const fs = require('fs');
|
||||
let _ = require('lodash');
|
||||
const path = require('path');
|
||||
|
||||
let cueTemplate = _.template(fs.readFileSync(`./plugins/qlab/cue.ejs`));
|
||||
let tileTemplate = _.template(fs.readFileSync(`./plugins/qlab/tile.ejs`));
|
||||
let cartTemplate = _.template(fs.readFileSync(`./plugins/qlab/cart.ejs`));
|
||||
let listTemplate = _.template(fs.readFileSync(`./plugins/qlab/cuelist.ejs`));
|
||||
let cueTemplate = _.template(fs.readFileSync(path.join(__dirname, `/plugins/qlab/cue.ejs`)));
|
||||
let tileTemplate = _.template(fs.readFileSync(path.join(__dirname, `/plugins/qlab/tile.ejs`)));
|
||||
let cartTemplate = _.template(fs.readFileSync(path.join(__dirname, `/plugins/qlab/cart.ejs`)));
|
||||
let listTemplate = _.template(fs.readFileSync(path.join(__dirname, `/plugins/qlab/cuelist.ejs`)));
|
||||
|
||||
%>
|
||||
|
||||
|
||||
+9
-7
@@ -1,6 +1,7 @@
|
||||
/* eslint-disable global-require */
|
||||
const fs = require('fs');
|
||||
const _ = require('lodash');
|
||||
const path = require('path');
|
||||
|
||||
const DEVICE = require('./device.js');
|
||||
const VIEW = require('./view.js');
|
||||
@@ -9,9 +10,12 @@ const allPlugins = {};
|
||||
module.exports.all = allPlugins;
|
||||
|
||||
module.exports.init = function init(callback) {
|
||||
console.log(`Loading plugin files... ${__dirname}/../plugins`);
|
||||
|
||||
fs.readdir(`${__dirname}/../plugins`, (err, files) => {
|
||||
let pluginDirectoryPath = path.normalize(path.join(__dirname, `../plugins`));
|
||||
|
||||
console.log(`Loading plugin files... ${pluginDirectoryPath}`);
|
||||
|
||||
fs.readdir(pluginDirectoryPath, (err, files) => {
|
||||
|
||||
files.forEach((plugin)=>{
|
||||
if (plugin[0] !== '.') {
|
||||
@@ -19,7 +23,7 @@ module.exports.init = function init(callback) {
|
||||
console.log(`${plugin} started`);
|
||||
|
||||
// eslint-disable-next-line import/no-dynamic-require
|
||||
allPlugins[plugin] = require(`${__dirname}/../plugins/${plugin}/main.js`);
|
||||
allPlugins[plugin] = require(path.join(pluginDirectoryPath, `/${plugin}/main.js`));
|
||||
|
||||
const p = allPlugins[plugin];
|
||||
|
||||
@@ -31,15 +35,13 @@ module.exports.init = function init(callback) {
|
||||
};
|
||||
|
||||
p.template = _.template(
|
||||
fs.readFileSync(
|
||||
`${__dirname}/../plugins/${plugin}/template.ejs`,
|
||||
fs.readFileSync(path.join(pluginDirectoryPath, `/${plugin}/template.ejs`),
|
||||
'utf8'
|
||||
)
|
||||
);
|
||||
|
||||
p.info = _.template(
|
||||
fs.readFileSync(
|
||||
`${__dirname}/../plugins/${plugin}/info.html`,
|
||||
fs.readFileSync(path.join(pluginDirectoryPath, `/${plugin}/info.html`),
|
||||
'utf8'
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user