-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-list
executable file
·26 lines (24 loc) · 975 Bytes
/
update-list
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env node
// const spawnSync = require('child_process').spawnSync;
//
// let siteList = spawnSync('terminus', ['site:list', '--format=json'], { encoding : 'utf8' });
// let sites = JSON.parse(siteList.stdout);
// let wordpressSites = Object.values(sites).filter((site) => (site.framework === 'wordpress' && !site.frozen));
//
// for (site of wordpressSites) {
// let terminusOutput = spawnSync('terminus', ['wp', site.id + '.live', '--', 'plugin', 'update', '--all', '--dry-run', '--format=json'], { encoding : 'utf8' });
// if (terminusOutput.stdout.length) {
// let row = [site.name];
// let pluginData;
// try {
// pluginData = JSON.parse(terminusOutput.stdout);
// } catch (e) {
// continue;
// }
// for (let plugin of pluginData) {
// row.push(`${plugin.name} ${plugin.update_version} (${plugin.status})`)
// }
// console.log(row.join(','));
// }
// }
wp plugin update --all --dry-run --format=summary