diff --git a/.gitignore b/.gitignore index 193830fb..4b30afdb 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,5 @@ google-drive-subtitles lib/ integration-test-config.json conf/*.toml +www/js/cytube-google-drive.user.js +www/js/cytube-google-drive.meta.js diff --git a/gdrive-userscript/generate-userscript.js b/gdrive-userscript/generate-userscript.js index 33b297e5..a37f0755 100644 --- a/gdrive-userscript/generate-userscript.js +++ b/gdrive-userscript/generate-userscript.js @@ -8,12 +8,30 @@ var includes = process.argv.slice(3).map(function (include) { var lines = String(fs.readFileSync( path.resolve(__dirname, 'cytube-google-drive.user.js'))).split('\n'); + +var userscriptOutput = ''; +var metaOutput = ''; lines.forEach(function (line) { if (line.match(/\{INCLUDE_BLOCK\}/)) { - console.log(includes); + userscriptOutput += includes + '\n'; } else if (line.match(/\{SITENAME\}/)) { - console.log(line.replace(/\{SITENAME\}/, sitename)); + line = line.replace(/\{SITENAME\}/, sitename) + '\n'; + userscriptOutput += line; + metaOutput += line; } else { - console.log(line); + if (line.match(/==\/?UserScript|@name|@version/)) { + metaOutput += line + '\n'; + } + + userscriptOutput += line + '\n'; } }); + +fs.writeFileSync( + path.join(__dirname, '..', 'www', 'js', 'cytube-google-drive.user.js'), + userscriptOutput +); +fs.writeFileSync( + path.join(__dirname, '..', 'www', 'js', 'cytube-google-drive.meta.js'), + metaOutput +); diff --git a/package.json b/package.json index 6797ef19..43831bf4 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Calvin Montgomery", "name": "CyTube", "description": "Online media synchronizer and chat", - "version": "3.47.1", + "version": "3.47.2", "repository": { "url": "http://github.com/calzoneman/sync" },