diff --git a/index.js b/index.js index 0e9c3448..954500ec 100755 --- a/index.js +++ b/index.js @@ -10,6 +10,8 @@ if (parseInt(ver[1], 10) < 6) { process.exit(1); } +checkPlayerExists(); + const args = parseArgs(); if (args.has('--daemonize')) { @@ -77,3 +79,20 @@ function parseArgs() { 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); + } +} diff --git a/package.json b/package.json index 2a04a591..c0ca7d87 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Calvin Montgomery", "name": "CyTube", "description": "Online media synchronizer and chat", - "version": "3.55.5", + "version": "3.55.6", "repository": { "url": "http://github.com/calzoneman/sync" },