mirror of https://github.com/calzoneman/sync.git
Kill process if www/js/player.js is not found at startup
This commit is contained in:
parent
2087921072
commit
c1e78fd4dc
19
index.js
19
index.js
|
@ -10,6 +10,8 @@ if (parseInt(ver[1], 10) < 6) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkPlayerExists();
|
||||||
|
|
||||||
const args = parseArgs();
|
const args = parseArgs();
|
||||||
|
|
||||||
if (args.has('--daemonize')) {
|
if (args.has('--daemonize')) {
|
||||||
|
@ -77,3 +79,20 @@ function parseArgs() {
|
||||||
|
|
||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkPlayerExists() {
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
const playerDotJs = path.join(__dirname, 'www', 'js', 'player.js');
|
||||||
|
|
||||||
|
if (!fs.existsSync(playerDotJs)) {
|
||||||
|
console.error(
|
||||||
|
'Missing video player: www/js/player.js. This should have been ' +
|
||||||
|
'automatically generated by the postinstall step of ' +
|
||||||
|
'`npm install`, but you can manually regenerate it by running ' +
|
||||||
|
'`npm run build-player`'
|
||||||
|
);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"author": "Calvin Montgomery",
|
"author": "Calvin Montgomery",
|
||||||
"name": "CyTube",
|
"name": "CyTube",
|
||||||
"description": "Online media synchronizer and chat",
|
"description": "Online media synchronizer and chat",
|
||||||
"version": "3.55.5",
|
"version": "3.55.6",
|
||||||
"repository": {
|
"repository": {
|
||||||
"url": "http://github.com/calzoneman/sync"
|
"url": "http://github.com/calzoneman/sync"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue