@xaidenlabs/uso 1.1.67 → 1.1.68

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.
@@ -49,4 +49,4 @@ const installLinux = async (shouldInstallRust, shouldInstallSolana) => {
49
49
  return true;
50
50
  };
51
51
 
52
- module.exports = { installLinux };
52
+ module.exports = { installLinux };
@@ -1,11 +1,12 @@
1
- const shell = require('shelljs');
2
- const { log, spinner } = require('../utils/logger');
3
- const { isWslInstalled, runWsl, toWslPath } = require('../utils/wsl-bridge');
4
- const path = require('path');
5
- const fs = require('fs');
6
- const os = require('os');
7
- const { spawnSync } = require('child_process');
8
- const chalk = require('chalk');
1
+ const shell = require("shelljs");
2
+ const { log, spinner } = require("../utils/logger");
3
+ const { isWslInstalled, runWsl, toWslPath } = require("../utils/wsl-bridge");
4
+ const path = require("path");
5
+ const fs = require("fs");
6
+ const os = require("os");
7
+ const { spawnSync } = require("child_process");
8
+ const chalk = require("chalk");
9
+ const WSL_DISTRO = "Ubuntu";
9
10
 
10
11
  /**
11
12
  * Installs the WSL Windows Feature via an elevated PowerShell UAC prompt.
@@ -13,107 +14,156 @@ const chalk = require('chalk');
13
14
  * Returns true if WSL is now available after the attempt, false otherwise.
14
15
  */
15
16
  const installWslFeature = async () => {
16
- log.warn("⚠️ WSL (Windows Subsystem for Linux) is not installed on this machine.");
17
- log.info("🛡️ Administrator permission is required to install WSL.");
18
- log.info("👉 A UAC (User Account Control) popup will appear — please click 'Yes' to allow the installation.");
19
- console.log("");
20
-
21
- // Run `wsl --install --no-distribution` elevated.
22
- // --no-distribution: only enables the WSL feature, does not pull a distro yet.
23
- // We wait for it to finish (-Wait) so we can check the result.
24
- const elevateCmd = `powershell -Command "Start-Process -FilePath 'wsl.exe' -ArgumentList '--install', '--no-distribution' -Verb RunAs -Wait"`;
25
- const result = shell.exec(elevateCmd, { silent: false });
26
-
27
- if (result.code !== 0) {
28
- // User likely denied UAC or the command failed
29
- log.error("❌ WSL installation was cancelled or failed.");
30
- log.warn("👉 To install manually, open PowerShell as Administrator and run:");
31
- console.log(chalk.bold.yellow(" wsl --install"));
32
- return false;
33
- }
34
-
35
- // Verify wsl is now available
36
- const check = shell.exec('wsl --status', { silent: true });
37
- if (check.code !== 0) {
38
- // WSL was just installed — a reboot is almost certainly required
39
- log.warn("⚠️ WSL feature has been installed, but a system restart is required to complete setup.");
40
- log.warn("👉 Please RESTART your computer, then run `uso install` again to set up the toolchain.");
41
- return false; // Signal caller that we need a restart before proceeding
42
- }
43
-
44
- log.success("✅ WSL feature installed successfully.");
45
- return true;
17
+ log.warn(
18
+ "⚠️ WSL (Windows Subsystem for Linux) is not installed on this machine.",
19
+ );
20
+ log.info("🛡️ Administrator permission is required to install WSL.");
21
+ log.info(
22
+ "👉 A UAC (User Account Control) popup will appear — please click 'Yes' to allow the installation.",
23
+ );
24
+ console.log("");
25
+
26
+ // Run `wsl --install --no-distribution` elevated.
27
+ // --no-distribution: only enables the WSL feature, does not pull a distro yet.
28
+ // We wait for it to finish (-Wait) so we can check the result.
29
+ const elevateCmd = `powershell -Command "Start-Process -FilePath 'wsl.exe' -ArgumentList '--install', '--no-distribution' -Verb RunAs -Wait"`;
30
+ const result = shell.exec(elevateCmd, { silent: false });
31
+
32
+ if (result.code !== 0) {
33
+ // User likely denied UAC or the command failed
34
+ log.error("❌ WSL installation was cancelled or failed.");
35
+ log.warn(
36
+ "👉 To install manually, open PowerShell as Administrator and run:",
37
+ );
38
+ console.log(chalk.bold.yellow(" wsl --install"));
39
+ return false;
40
+ }
41
+
42
+ // Verify wsl is now available
43
+ const check = shell.exec("wsl --status", { silent: true });
44
+ if (check.code !== 0) {
45
+ // WSL was just installed — a reboot is almost certainly required
46
+ log.warn(
47
+ "⚠️ WSL feature has been installed, but a system restart is required to complete setup.",
48
+ );
49
+ log.warn(
50
+ "👉 Please RESTART your computer, then run `uso install` again to set up the toolchain.",
51
+ );
52
+ return false; // Signal caller that we need a restart before proceeding
53
+ }
54
+
55
+ log.success("✅ WSL feature installed successfully.");
56
+ return true;
46
57
  };
47
58
 
48
59
  const installWsl = async () => {
49
- log.header("🐧 Configuring Stealth WSL Environment...");
50
-
51
- // 1. Check if WSL is enabled
52
- if (!shell.which('wsl')) {
53
- log.error("❌ WSL is not enabled on this Windows machine.");
54
- log.warn("👉 Please enable 'Windows Subsystem for Linux' in 'Turn Windows features on or off'.");
55
- log.warn("👉 Or run this in PowerShell as Admin: wsl --install");
56
- return false;
60
+ log.header("🐧 Configuring Stealth WSL Environment...");
61
+
62
+ // 1. Check if WSL is enabled
63
+ if (!shell.which("wsl")) {
64
+ log.error("❌ WSL is not enabled on this Windows machine.");
65
+ log.warn(
66
+ "👉 Please enable 'Windows Subsystem for Linux' in 'Turn Windows features on or off'.",
67
+ );
68
+ log.warn("👉 Or run this in PowerShell as Admin: wsl --install");
69
+ return false;
70
+ }
71
+
72
+ // 2. Install Ubuntu silently (Branded as Uso Engine)
73
+ // We use 'wsl -d Ubuntu -e true' to check if it's installed and runnable.
74
+ // 'wsl -l -v' output is notoriously unreliable due to charset encoding (UTF-16) on Windows.
75
+ const checkDistro = shell.exec(`wsl -d ${WSL_DISTRO} -e true`, {
76
+ silent: true,
77
+ });
78
+
79
+ // If exit code is 0, it's installed and working.
80
+ if (checkDistro.code !== 0) {
81
+ log.info(
82
+ "📦 Configuring Uso Engine (Please approve UAC prompt if asked)...",
83
+ );
84
+ log.warn("⏳ This may take a few minutes (Downloading ~500MB)...");
85
+
86
+ // Helper to try install commands
87
+ const tryInstall = (args, description) => {
88
+ log.info(`👉 Attempting: ${description}...`);
89
+ // Fix Deprecation: shell: false is safer and prevents warning
90
+ const proc = spawnSync("wsl", args, { stdio: "inherit", shell: false });
91
+ return proc.status === 0;
92
+ };
93
+
94
+ // Attempt 1: Standard Install
95
+ let success = tryInstall(
96
+ ["--install", "-d", WSL_DISTRO],
97
+ "Standard Install",
98
+ );
99
+
100
+ // Attempt 2: Update WSL Kernel (Fixes network/protocol issues)
101
+ if (!success) {
102
+ log.warn(
103
+ "⚠️ Standard install failed. Attempting to update WSL kernel...",
104
+ );
105
+ spawnSync("wsl", ["--update"], { stdio: "inherit", shell: false });
106
+ success = tryInstall(
107
+ ["--install", "-d", WSL_DISTRO],
108
+ "Install after Update",
109
+ );
57
110
  }
58
111
 
59
- // 2. Install Ubuntu silently (Branded as Uso Engine)
60
- // We use 'wsl -d Ubuntu -e true' to check if it's installed and runnable.
61
- // 'wsl -l -v' output is notoriously unreliable due to charset encoding (UTF-16) on Windows.
62
- const checkDistro = shell.exec('wsl -d Ubuntu -e true', { silent: true });
63
-
64
- // If exit code is 0, it's installed and working.
65
- if (checkDistro.code !== 0) {
66
- log.info("📦 Configuring Uso Engine (Please approve UAC prompt if asked)...");
67
- log.warn("⏳ This may take a few minutes (Downloading ~500MB)...");
68
-
69
- // Helper to try install commands
70
- const tryInstall = (args, description) => {
71
- log.info(`👉 Attempting: ${description}...`);
72
- // Fix Deprecation: shell: false is safer and prevents warning
73
- const proc = spawnSync('wsl', args, { stdio: 'inherit', shell: false });
74
- return proc.status === 0;
75
- };
76
-
77
- // Attempt 1: Standard Install
78
- let success = tryInstall(['--install', '-d', 'Ubuntu'], 'Standard Install');
79
-
80
- // Attempt 2: Update WSL Kernel (Fixes network/protocol issues)
81
- if (!success) {
82
- log.warn("⚠️ Standard install failed. Attempting to update WSL kernel...");
83
- spawnSync('wsl', ['--update'], { stdio: 'inherit', shell: false });
84
- success = tryInstall(['--install', '-d', 'Ubuntu'], 'Install after Update');
85
- }
112
+ // Attempt 3: Web Download (Bypasses Microsoft Store blocks)
113
+ if (!success) {
114
+ log.warn("⚠️ Still failing. Trying --web-download (Bypasses Store)...");
115
+ success = tryInstall(
116
+ ["--install", "-d", WSL_DISTRO, "--web-download"],
117
+ "Web Download Install",
118
+ );
119
+ }
86
120
 
87
- // Attempt 3: Web Download (Bypasses Microsoft Store blocks)
88
- if (!success) {
89
- log.warn("⚠️ Still failing. Trying --web-download (Bypasses Store)...");
90
- success = tryInstall(['--install', '-d', 'Ubuntu', '--web-download'], 'Web Download Install');
91
- }
121
+ // Final Failure Handler
122
+ if (!success) {
123
+ log.error(" Failed to configure Uso Engine.");
124
+ log.error("🛑 Possible Causes: Internet Timeout, Firewall, or VPN.");
125
+ log.warn(
126
+ "\n👉 ACTION REQUIRED: Run this command manually in PowerShell as Administrator:",
127
+ );
128
+ console.log(
129
+ chalk.bold.yellow(
130
+ ` wsl --install -d ${WSL_DISTRO} --web-download`,
131
+ ),
132
+ );
133
+ log.warn(
134
+ "\nOnce that completes successfully, run 'uso setup --wsl' again.",
135
+ );
136
+ return false;
137
+ }
92
138
 
93
- // Final Failure Handler
94
- if (!success) {
95
- log.error("❌ Failed to configure Uso Engine.");
96
- log.error("🛑 Possible Causes: Internet Timeout, Firewall, or VPN.");
97
- log.warn("\n👉 ACTION REQUIRED: Run this command manually in PowerShell as Administrator:");
98
- console.log(chalk.bold.yellow(" wsl --install -d Ubuntu --web-download"));
99
- log.warn("\nOnce that completes successfully, run 'uso setup --wsl' again.");
100
- return false;
101
- }
102
- log.success("✅ Uso Engine configured.");
103
- } else {
104
- log.success("✅ Uso Engine is ready.");
139
+ const verifyInstall = shell.exec(`wsl -d ${WSL_DISTRO} -e true`, {
140
+ silent: true,
141
+ });
142
+ if (verifyInstall.code !== 0) {
143
+ log.warn(
144
+ `⚠️ ${WSL_DISTRO} is not ready yet. WSL installation usually needs a full system reboot before the distro becomes available.`,
145
+ );
146
+ log.warn(
147
+ "👉 Restart Windows, then run 'uso install' again to continue the setup.",
148
+ );
149
+ return false;
105
150
  }
106
151
 
107
- // 2.5 Hide from Windows Terminal (Stealth Mode)
108
- hideFromWindowsTerminal();
152
+ log.success("✅ Uso Engine configured.");
153
+ } else {
154
+ log.success("✅ Uso Engine is ready.");
155
+ }
156
+
157
+ // 2.5 Hide from Windows Terminal (Stealth Mode)
158
+ hideFromWindowsTerminal();
109
159
 
110
- // 3. Configure Internal Environment (Rust + Solana + Anchor)
111
- // We create a shell script and run it inside WSL.
160
+ // 3. Configure Internal Environment (Rust + Solana + Anchor)
161
+ // We create a shell script and run it inside WSL.
112
162
 
113
- log.info("⚙️ Initializing Uso Engine environment...");
163
+ log.info("⚙️ Initializing Uso Engine environment...");
114
164
 
115
- // --- PHASE 1: System Dependencies (as root, no sudo needed) ---
116
- const rootScript = `
165
+ // --- PHASE 1: System Dependencies (as root, no sudo needed) ---
166
+ const rootScript = `
117
167
  #!/bin/bash
118
168
  set -e
119
169
  export DEBIAN_FRONTEND=noninteractive
@@ -126,25 +176,27 @@ if ! command -v cc &> /dev/null || ! command -v pkg-config &> /dev/null; then
126
176
  else
127
177
  echo "✅ Build tools already present."
128
178
  fi
129
- `.replace(/\r\n/g, '\n');
130
-
131
- const rootScriptPath = path.join(process.cwd(), 'uso_root_setup.sh');
132
- fs.writeFileSync(rootScriptPath, rootScript);
133
- const wslRootScriptPath = toWslPath(rootScriptPath);
134
-
135
- const spin1 = spinner('Phase 1/2: Installing system dependencies...').start();
136
- const rootRes = shell.exec(`wsl -d Ubuntu -u root -e bash "${wslRootScriptPath}"`);
137
- fs.unlinkSync(rootScriptPath);
138
-
139
- if (rootRes.code !== 0) {
140
- spin1.fail('System dependency installation failed.');
141
- log.error(rootRes.stderr || 'Unknown error during root setup.');
142
- return false;
143
- }
144
- spin1.succeed('System dependencies ready.');
145
-
146
- // --- PHASE 2: User Tools (Rust, Solana, Anchor as normal user) ---
147
- const userScript = `
179
+ `.replace(/\r\n/g, "\n");
180
+
181
+ const rootScriptPath = path.join(process.cwd(), "uso_root_setup.sh");
182
+ fs.writeFileSync(rootScriptPath, rootScript);
183
+ const wslRootScriptPath = toWslPath(rootScriptPath);
184
+
185
+ const spin1 = spinner("Phase 1/2: Installing system dependencies...").start();
186
+ const rootRes = shell.exec(
187
+ `wsl -d ${WSL_DISTRO} -u root -e bash "${wslRootScriptPath}"`,
188
+ );
189
+ fs.unlinkSync(rootScriptPath);
190
+
191
+ if (rootRes.code !== 0) {
192
+ spin1.fail("System dependency installation failed.");
193
+ log.error(rootRes.stderr || "Unknown error during root setup.");
194
+ return false;
195
+ }
196
+ spin1.succeed("System dependencies ready.");
197
+
198
+ // --- PHASE 2: User Tools (Rust, Solana, Anchor as normal user) ---
199
+ const userScript = `
148
200
  #!/bin/bash
149
201
  # NO set -e — we handle errors per-step
150
202
  FAILURES=""
@@ -154,17 +206,41 @@ touch ~/.hushlogin
154
206
 
155
207
  # --- Rust ---
156
208
  source $HOME/.cargo/env 2>/dev/null || true
157
- if ! command -v cargo &> /dev/null; then
158
- echo "🦀 Installing Rust..."
159
- if curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y; then
209
+
210
+ # rustc can exist but still fail if component/toolchain is broken.
211
+ if command -v rustc &> /dev/null && rustc --version >/dev/null 2>&1; then
212
+ echo "✅ Rust already installed."
213
+ else
214
+ # If rustup exists, try repairing first.
215
+ if command -v rustup &> /dev/null; then
216
+ echo "🦀 Repairing Rust toolchain..."
217
+ rustup toolchain install stable >/dev/null 2>&1 || true
218
+ rustup default stable >/dev/null 2>&1 || true
219
+ rustup component add rustc cargo >/dev/null 2>&1 || true
160
220
  source $HOME/.cargo/env 2>/dev/null || true
161
- echo "✅ Rust installed."
221
+ fi
222
+
223
+ if command -v rustc &> /dev/null && rustc --version >/dev/null 2>&1; then
224
+ echo "✅ Rust repaired."
162
225
  else
163
- FAILURES="$FAILURES rust"
164
- echo "❌ Rust installation failed."
226
+ echo "🦀 Installing Rust..."
227
+ if curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y; then
228
+ source $HOME/.cargo/env 2>/dev/null || true
229
+ rustup toolchain install stable >/dev/null 2>&1 || true
230
+ rustup default stable >/dev/null 2>&1 || true
231
+ rustup component add rustc cargo >/dev/null 2>&1 || true
232
+
233
+ if command -v rustc &> /dev/null && rustc --version >/dev/null 2>&1; then
234
+ echo "✅ Rust installed."
235
+ else
236
+ FAILURES="$FAILURES rust"
237
+ echo "❌ Rust install completed but rustc is not runnable."
238
+ fi
239
+ else
240
+ FAILURES="$FAILURES rust"
241
+ echo "❌ Rust installation failed."
242
+ fi
165
243
  fi
166
- else
167
- echo "✅ Rust already installed."
168
244
  fi
169
245
  source $HOME/.cargo/env 2>/dev/null || true
170
246
 
@@ -231,83 +307,98 @@ else
231
307
  echo "Run 'uso setup' again to retry failed components."
232
308
  exit 1
233
309
  fi
234
- `.replace(/\r\n/g, '\n');
235
-
236
- const userScriptPath = path.join(process.cwd(), 'uso_user_setup.sh');
237
- fs.writeFileSync(userScriptPath, userScript);
238
- const wslUserScriptPath = toWslPath(userScriptPath);
239
-
240
- const spin2 = spinner('Phase 2/2: Installing Rust, Solana, Anchor (this takes a while)...').start();
241
- const userRes = shell.exec(`wsl -d Ubuntu -e bash "${wslUserScriptPath}"`);
242
- fs.unlinkSync(userScriptPath);
243
-
244
- if (userRes.code === 0) {
245
- spin2.succeed('Uso Engine configured successfully.');
246
- } else {
247
- spin2.warn('Uso Engine partially configured (some downloads timed out).');
248
- log.info("👉 Run 'uso setup' again to retry failed components.");
249
- }
250
-
251
- // Always set stealth mode config — even partial setup enables routing
252
- const configPath = path.join(os.homedir(), '.uso-config.json');
253
- const config = { mode: 'wsl', distro: 'Ubuntu' };
254
- fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
255
-
256
- log.success("✅ Stealth Mode Enabled. 'uso' commands will now run via WSL.");
257
- return true;
310
+ `.replace(/\r\n/g, "\n");
311
+
312
+ const userScriptPath = path.join(process.cwd(), "uso_user_setup.sh");
313
+ fs.writeFileSync(userScriptPath, userScript);
314
+ const wslUserScriptPath = toWslPath(userScriptPath);
315
+
316
+ const spin2 = spinner(
317
+ "Phase 2/2: Installing Rust, Solana, Anchor (this takes a while)...",
318
+ ).start();
319
+ const userRes = shell.exec(`wsl -d ${WSL_DISTRO} -e bash "${wslUserScriptPath}"`);
320
+ fs.unlinkSync(userScriptPath);
321
+
322
+ if (userRes.code === 0) {
323
+ spin2.succeed("Uso Engine configured successfully.");
324
+ } else {
325
+ spin2.warn("Uso Engine partially configured (some downloads timed out).");
326
+ log.info("👉 Run 'uso setup' again to retry failed components.");
327
+ }
328
+
329
+ // Always set stealth mode config even partial setup enables routing
330
+ const configPath = path.join(os.homedir(), ".uso-config.json");
331
+ const config = { mode: "wsl", distro: WSL_DISTRO };
332
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
333
+
334
+ log.success("✅ Stealth Mode Enabled. 'uso' commands will now run via WSL.");
335
+ return true;
258
336
  };
259
337
 
260
338
  const hideFromWindowsTerminal = () => {
261
- try {
262
- const localAppData = process.env.LOCALAPPDATA;
263
- const packagesPath = path.join(localAppData, 'Packages');
264
-
265
- // Find Windows Terminal package folder (name varies slightly but starts with Microsoft.WindowsTerminal)
266
- if (!fs.existsSync(packagesPath)) return;
267
-
268
- const terminalDirs = fs.readdirSync(packagesPath).filter(name => name.startsWith('Microsoft.WindowsTerminal'));
269
-
270
- if (terminalDirs.length === 0) return;
271
-
272
- const settingsPath = path.join(packagesPath, terminalDirs[0], 'LocalState', 'settings.json');
273
-
274
- if (fs.existsSync(settingsPath)) {
275
- // Read settings
276
- // Note: settings.json can contain comments which JSON.parse fails on.
277
- // We'll use a simple regex to set hidden: true for Ubuntu if simpler parsing fails or just try.
278
- // Actually, modifying this file safely without a robust comment-stripping parser is risky.
279
- // A safer approach for "Stealth" might be just log that we configured it.
280
- // BUT, if we want to do it, we should be careful.
281
-
282
- // For now, let's just log a message that we would hide it,
283
- // or maybe we skip the robust parsing complexity to avoid breaking their terminal settings.
284
- // User requested "Programmatically edit".
285
-
286
- const content = fs.readFileSync(settingsPath, 'utf8');
287
- // Check if Ubuntu is already there
288
- if (content.includes('"name": "Ubuntu"')) {
289
- // Very naive replacement to inject hidden: true.
290
- // We look for the Ubuntu profile block.
291
- // This is brittle. Let's try to parse if valid JSON.
292
- try {
293
- const settings = JSON.parse(content);
294
- if (settings.profiles && settings.profiles.list) {
295
- const profile = settings.profiles.list.find(p => p.name === 'Ubuntu');
296
- if (profile) {
297
- profile.hidden = true;
298
- fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 4));
299
- log.info("🕵️ Hid 'Ubuntu' from Windows Terminal (Stealth Mode Active).");
300
- }
301
- }
302
- } catch (e) {
303
- // JSON parse failed (likely due to comments in settings.json)
304
- log.warn("⚠️ Could not automatically hide Ubuntu icon (Comments in settings.json).");
305
- }
339
+ try {
340
+ const localAppData = process.env.LOCALAPPDATA;
341
+ const packagesPath = path.join(localAppData, "Packages");
342
+
343
+ // Find Windows Terminal package folder (name varies slightly but starts with Microsoft.WindowsTerminal)
344
+ if (!fs.existsSync(packagesPath)) return;
345
+
346
+ const terminalDirs = fs
347
+ .readdirSync(packagesPath)
348
+ .filter((name) => name.startsWith("Microsoft.WindowsTerminal"));
349
+
350
+ if (terminalDirs.length === 0) return;
351
+
352
+ const settingsPath = path.join(
353
+ packagesPath,
354
+ terminalDirs[0],
355
+ "LocalState",
356
+ "settings.json",
357
+ );
358
+
359
+ if (fs.existsSync(settingsPath)) {
360
+ // Read settings
361
+ // Note: settings.json can contain comments which JSON.parse fails on.
362
+ // We'll use a simple regex to set hidden: true for Ubuntu if simpler parsing fails or just try.
363
+ // Actually, modifying this file safely without a robust comment-stripping parser is risky.
364
+ // A safer approach for "Stealth" might be just log that we configured it.
365
+ // BUT, if we want to do it, we should be careful.
366
+
367
+ // For now, let's just log a message that we would hide it,
368
+ // or maybe we skip the robust parsing complexity to avoid breaking their terminal settings.
369
+ // User requested "Programmatically edit".
370
+
371
+ const content = fs.readFileSync(settingsPath, "utf8");
372
+ // Check if Ubuntu is already there
373
+ if (content.includes('"name": "Ubuntu"')) {
374
+ // Very naive replacement to inject hidden: true.
375
+ // We look for the Ubuntu profile block.
376
+ // This is brittle. Let's try to parse if valid JSON.
377
+ try {
378
+ const settings = JSON.parse(content);
379
+ if (settings.profiles && settings.profiles.list) {
380
+ const profile = settings.profiles.list.find(
381
+ (p) => p.name === "Ubuntu",
382
+ );
383
+ if (profile) {
384
+ profile.hidden = true;
385
+ fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 4));
386
+ log.info(
387
+ "🕵️ Hid 'Ubuntu' from Windows Terminal (Stealth Mode Active).",
388
+ );
306
389
  }
390
+ }
391
+ } catch (e) {
392
+ // JSON parse failed (likely due to comments in settings.json)
393
+ log.warn(
394
+ "⚠️ Could not automatically hide Ubuntu icon (Comments in settings.json).",
395
+ );
307
396
  }
308
- } catch (e) {
309
- // Silently fail to avoid alarming user
397
+ }
310
398
  }
399
+ } catch (e) {
400
+ // Silently fail to avoid alarming user
401
+ }
311
402
  };
312
403
 
313
404
  module.exports = { installWslFeature, installWsl };