@telelabsai/ship 1.1.12 → 1.1.16
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/cli/commands/sync.js +43 -19
- package/package.json +1 -1
package/cli/commands/sync.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const https = require('https');
|
|
2
2
|
const http = require('http');
|
|
3
|
-
const { execSync
|
|
3
|
+
const { execSync } = require('child_process');
|
|
4
4
|
const fs = require('fs');
|
|
5
5
|
const path = require('path');
|
|
6
6
|
const prompts = require('prompts');
|
|
@@ -97,11 +97,10 @@ function sync(args) {
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
// Install via claude plugin add
|
|
100
|
+
// Install via claude plugin marketplace add + plugin install
|
|
101
101
|
console.log(`\n Installing "${selected.name}"...\n`);
|
|
102
102
|
|
|
103
103
|
try {
|
|
104
|
-
// Check if claude is installed
|
|
105
104
|
execSync('claude --version', { stdio: 'pipe' });
|
|
106
105
|
} catch {
|
|
107
106
|
console.error(' Error: Claude Code is not installed.');
|
|
@@ -109,25 +108,50 @@ function sync(args) {
|
|
|
109
108
|
process.exit(1);
|
|
110
109
|
}
|
|
111
110
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
111
|
+
// Step 1: Add the marketplace
|
|
112
|
+
console.log(' Adding marketplace...\n');
|
|
113
|
+
try {
|
|
114
|
+
execSync(`claude plugin marketplace add ${selected.deployUrl}`, {
|
|
115
|
+
stdio: 'inherit',
|
|
116
|
+
cwd: process.cwd(),
|
|
117
|
+
});
|
|
118
|
+
} catch (err) {
|
|
119
|
+
console.error(`\n Failed to add marketplace.\n`);
|
|
120
|
+
process.exit(1);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Step 2: Install each plugin
|
|
124
|
+
const plugins = selected.plugins || [];
|
|
125
|
+
const marketplaceName = selected.marketplaceName;
|
|
126
|
+
|
|
127
|
+
if (!marketplaceName || plugins.length === 0) {
|
|
128
|
+
console.log(' ✓ Marketplace added. No plugins to auto-install.\n');
|
|
129
|
+
saveSyncConfig(process.cwd(), selected.slug);
|
|
130
|
+
process.exit(0);
|
|
131
|
+
}
|
|
116
132
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
133
|
+
let failed = false;
|
|
134
|
+
for (const plugin of plugins) {
|
|
135
|
+
const installId = `${plugin.name}@${marketplaceName}`;
|
|
136
|
+
console.log(` Installing ${installId}...\n`);
|
|
137
|
+
try {
|
|
138
|
+
execSync(`claude plugin install ${installId}`, {
|
|
139
|
+
stdio: 'inherit',
|
|
140
|
+
cwd: process.cwd(),
|
|
141
|
+
});
|
|
142
|
+
} catch {
|
|
143
|
+
console.error(` Failed to install ${installId}\n`);
|
|
144
|
+
failed = true;
|
|
123
145
|
}
|
|
124
|
-
|
|
125
|
-
});
|
|
146
|
+
}
|
|
126
147
|
|
|
127
|
-
|
|
128
|
-
console.
|
|
129
|
-
|
|
130
|
-
|
|
148
|
+
if (!failed) {
|
|
149
|
+
console.log(`\n ✓ "${selected.name}" installed successfully.\n`);
|
|
150
|
+
} else {
|
|
151
|
+
console.log(`\n ⚠ Some plugins failed to install.\n`);
|
|
152
|
+
}
|
|
153
|
+
saveSyncConfig(process.cwd(), selected.slug);
|
|
154
|
+
process.exit(failed ? 1 : 0);
|
|
131
155
|
});
|
|
132
156
|
}
|
|
133
157
|
|