@gricha/perry 0.3.14 → 0.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/api.js +8 -0
- package/dist/index.js +27 -3
- package/dist/perry-worker +0 -0
- package/package.json +1 -1
package/dist/client/api.js
CHANGED
|
@@ -98,6 +98,14 @@ export class ApiClient {
|
|
|
98
98
|
throw this.wrapError(err);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
+
async syncAllWorkspaces() {
|
|
102
|
+
try {
|
|
103
|
+
return await this.client.workspaces.syncAll();
|
|
104
|
+
}
|
|
105
|
+
catch (err) {
|
|
106
|
+
throw this.wrapError(err);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
101
109
|
async getPortForwards(name) {
|
|
102
110
|
try {
|
|
103
111
|
const result = await this.client.workspaces.getPortForwards({ name });
|
package/dist/index.js
CHANGED
|
@@ -279,11 +279,35 @@ program
|
|
|
279
279
|
}
|
|
280
280
|
});
|
|
281
281
|
program
|
|
282
|
-
.command('sync
|
|
283
|
-
.description('Sync credentials and files to
|
|
284
|
-
.
|
|
282
|
+
.command('sync [name]')
|
|
283
|
+
.description('Sync credentials and files to workspaces')
|
|
284
|
+
.option('-a, --all', 'Sync all running workspaces')
|
|
285
|
+
.action(async (name, options) => {
|
|
285
286
|
try {
|
|
286
287
|
const client = await getClient();
|
|
288
|
+
if (options.all) {
|
|
289
|
+
console.log('Syncing all running workspaces...');
|
|
290
|
+
const result = await client.syncAllWorkspaces();
|
|
291
|
+
if (result.results.length === 0) {
|
|
292
|
+
console.log('No running workspaces to sync.');
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
for (const r of result.results) {
|
|
296
|
+
if (r.success) {
|
|
297
|
+
console.log(` ✓ ${r.name}`);
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
console.log(` ✗ ${r.name}: ${r.error}`);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
console.log('');
|
|
304
|
+
console.log(`Synced: ${result.synced}, Failed: ${result.failed}`);
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
if (!name) {
|
|
308
|
+
console.error('Error: workspace name required (or use --all)');
|
|
309
|
+
process.exit(1);
|
|
310
|
+
}
|
|
287
311
|
console.log(`Syncing credentials to workspace '${name}'...`);
|
|
288
312
|
await client.syncWorkspace(name);
|
|
289
313
|
console.log(`Workspace '${name}' synced.`);
|
package/dist/perry-worker
CHANGED
|
Binary file
|