Content deleted Content added
Syncing script from GitHub (via script) |
Syncing script from GitHub (via script) |
||
Line 21:
event.preventDefault();
const latestCommitHash = (yield (yield fetch(`https://api.github.com/repos/${repoOwner}/${repoName}/commits`)).json())[0].sha;
const scriptData = (yield (yield fetch(`https://raw.githubusercontent.com/${repoOwner}/${repoName}/${latestCommitHash}/scripts.json`)).json());
mw.notify('Syncing scripts...', { autoHide: false, tag: 'sync-scripts-notification' });
yield Promise.all(scriptData.map((script) => __awaiter(void 0, void 0, void 0, function* () {
Line 80:
yield new mw.Api()
.edit(title, () => ({ text, summary, watchlist: 'watch' }))
.catch((
if (
yield new mw.Api().create(title, { summary, watchlist: 'watch' }, text).catch((
return;
});
else {
return;
}
|