push
This commit is contained in:
1 parent
bcf05e8063
commit
f37985b4c8
109 files changed
+22810
-6143
No files matched your search
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env node
|
||||
// Copy providers + manifest from an All-in-One-Nuvio checkout.
|
||||
// usage: node scripts/sync-providers.js <path-to-All-in-One-Nuvio>
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const src = process.argv[2];
|
||||
if (!src) {
|
||||
console.error('usage: sync-providers.js <path-to-All-in-One-Nuvio>');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const dest = path.join(__dirname, '..', 'providers');
|
||||
const srcProviders = path.join(src, 'providers');
|
||||
fs.mkdirSync(dest, { recursive: true });
|
||||
|
||||
let added = 0;
|
||||
let updated = 0;
|
||||
for (const file of fs.readdirSync(srcProviders).filter((f) => f.endsWith('.js'))) {
|
||||
const from = path.join(srcProviders, file);
|
||||
const to = path.join(dest, file);
|
||||
const next = fs.readFileSync(from);
|
||||
if (!fs.existsSync(to)) added++;
|
||||
else if (!fs.readFileSync(to).equals(next)) updated++;
|
||||
else continue;
|
||||
fs.writeFileSync(to, next);
|
||||
}
|
||||
fs.copyFileSync(path.join(src, 'manifest.json'), path.join(dest, 'manifest.json'));
|
||||
console.log(`providers: ${added} added, ${updated} updated`);
|
||||
Reference in new issue
Block a user