Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function main () {
var input = process.argv[2]
var output = process.argv[3]
var str = input
if (typeof input === 'string' &&
input.match(/(^-*h(elp)?$)|(^\/\?$)/gi)) {
console.log(help)
return
} else if (typeof input === 'string' &&
input.match(/(^-*v(ersion)?$)|(^\/\?$)/gi)) {
process.chdir(__dirname)
git.short(function (sha) {
console.log(pkg.version + (sha ? ('+' + sha) : ''))
})
return
}
if (!input) {
console.log('Enter generator string (submit with Ctrl-D):')
var ps = prompt()
ps.multiline(function (err, lines, str) {
ps.close()
if (err) {
return
}
if (str !== '' && str.slice(-1) !== '\n') {
console.log('')
}
generate(str)
function startServers(data) {
try {
git.short(function (str) {
logger.notice('Starting Commit', str)
})
} catch(e) {
logger.error(e.stack || e);
}
try {
config = JSON.parse(data);
const LOCAL_IP = config.ip;
logger.notice("Starting PopcornTV");
dns.startDnsProxy(LOCAL_IP);
webservers.startWebServer(LOCAL_IP);
webservers.startSSLWebServer(LOCAL_IP);
} catch (err) {
logger.error('There is an error starting Popcorn TV, please post this on the Github page')
logger.error(err.stack || err);
gulp.task("write-build-info", function (cb) {
var buildInfos = {
version : packagejson.version
};
require("git-rev").short(function (str) {
buildInfos.commit = str;
fs.writeFile(paths.out.build_info, JSON.stringify(buildInfos, null, 2), cb);
});
});
new Promise(resolve => {
git.short(resolve);
}),
new Promise(resolve => {