@xaidenlabs/uso 1.1.92 → 1.1.94
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/package.json +1 -1
- package/src/commands/doctor.js +46 -6
package/package.json
CHANGED
package/src/commands/doctor.js
CHANGED
|
@@ -224,12 +224,52 @@ const doctor = async () => {
|
|
|
224
224
|
);
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
|
|
228
|
-
if (
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
227
|
+
const missing = [];
|
|
228
|
+
if (!checkGit()) missing.push({name: 'Git', component: 'git'});
|
|
229
|
+
if (platform === "win32" && !checkWsl()) missing.push({name: 'WSL', component: 'wsl'});
|
|
230
|
+
if (!checkRust()) missing.push({name: 'Rust', component: 'rust'});
|
|
231
|
+
if (!checkSolana()) missing.push({name: 'Solana CLI', component: 'solana'});
|
|
232
|
+
if (!checkAnchor()) missing.push({name: 'Anchor', component: 'anchor'});
|
|
233
|
+
if (!checkCppTools()) missing.push({name: 'C++ Build Tools', component: 'cpptools'});
|
|
234
|
+
|
|
235
|
+
if (missing.length > 0) {
|
|
236
|
+
console.log("");
|
|
237
|
+
log.info("⚠️ Some components are missing.");
|
|
238
|
+
const { init } = require("./init");
|
|
239
|
+
const readline = require("readline");
|
|
240
|
+
const rl = readline.createInterface({
|
|
241
|
+
input: process.stdin,
|
|
242
|
+
output: process.stdout,
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
const ask = (q) => new Promise((resolve) => rl.question(q, resolve));
|
|
246
|
+
|
|
247
|
+
for (const item of missing) {
|
|
248
|
+
const ans = await ask(`🤔 Do you want to install ${item.name}? (y/N): `);
|
|
249
|
+
if (ans.trim().toLowerCase() === 'y') {
|
|
250
|
+
if (item.component === 'git') {
|
|
251
|
+
log.warn("👉 Git cannot be installed automatically yet. Please install it manually.");
|
|
252
|
+
} else if (item.component === 'cpptools') {
|
|
253
|
+
log.warn("👉 Please install C++ Build Tools manually from: https://visualstudio.microsoft.com/visual-cpp-build-tools/");
|
|
254
|
+
} else if (item.component === 'wsl' || platform === "win32") {
|
|
255
|
+
// On Windows, the init command automatically provisions the entire WSL environment with all components
|
|
256
|
+
log.info(`🚀 Starting installation...`);
|
|
257
|
+
await init();
|
|
258
|
+
// If we run full init on Windows, it installs everything, so we can break the loop
|
|
259
|
+
break;
|
|
260
|
+
} else {
|
|
261
|
+
log.info(`🚀 Installing ${item.name}...`);
|
|
262
|
+
await init(item.component);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
rl.close();
|
|
267
|
+
console.log("");
|
|
268
|
+
log.success("🩺 Doctor completed. Please run 'uso doctor' again to verify.");
|
|
269
|
+
} else {
|
|
270
|
+
console.log("");
|
|
271
|
+
log.success("🎉 Everything looks good! You're ready to build.");
|
|
272
|
+
}
|
|
233
273
|
};
|
|
234
274
|
|
|
235
275
|
module.exports = {
|