mirror of https://github.com/calzoneman/sync.git
Generate .meta.js for gdrive userscript for update checks
Tampermonkey automatically requests www/js/cytube-google-drive.meta.js to check for updates. Changed the userscript generator to write an additional .meta.js file so that works instead of 404ing.
This commit is contained in:
parent
9f0444a962
commit
0885a619b9
|
@ -14,3 +14,5 @@ google-drive-subtitles
|
||||||
lib/
|
lib/
|
||||||
integration-test-config.json
|
integration-test-config.json
|
||||||
conf/*.toml
|
conf/*.toml
|
||||||
|
www/js/cytube-google-drive.user.js
|
||||||
|
www/js/cytube-google-drive.meta.js
|
||||||
|
|
|
@ -8,12 +8,30 @@ var includes = process.argv.slice(3).map(function (include) {
|
||||||
|
|
||||||
var lines = String(fs.readFileSync(
|
var lines = String(fs.readFileSync(
|
||||||
path.resolve(__dirname, 'cytube-google-drive.user.js'))).split('\n');
|
path.resolve(__dirname, 'cytube-google-drive.user.js'))).split('\n');
|
||||||
|
|
||||||
|
var userscriptOutput = '';
|
||||||
|
var metaOutput = '';
|
||||||
lines.forEach(function (line) {
|
lines.forEach(function (line) {
|
||||||
if (line.match(/\{INCLUDE_BLOCK\}/)) {
|
if (line.match(/\{INCLUDE_BLOCK\}/)) {
|
||||||
console.log(includes);
|
userscriptOutput += includes + '\n';
|
||||||
} else if (line.match(/\{SITENAME\}/)) {
|
} else if (line.match(/\{SITENAME\}/)) {
|
||||||
console.log(line.replace(/\{SITENAME\}/, sitename));
|
line = line.replace(/\{SITENAME\}/, sitename) + '\n';
|
||||||
|
userscriptOutput += line;
|
||||||
|
metaOutput += line;
|
||||||
} else {
|
} 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
|
||||||
|
);
|
||||||
|
|
|
@ -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.47.1",
|
"version": "3.47.2",
|
||||||
"repository": {
|
"repository": {
|
||||||
"url": "http://github.com/calzoneman/sync"
|
"url": "http://github.com/calzoneman/sync"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue