Skip to content

Commit 6169cd3

Browse files
garthvhclaude
andcommitted
apps: auto-install the status-bar extension on Open Project in VS Code
Both apps now bundle vscode-extension/ (mac build-app.sh copies it into the app Resources; windows csproj copies it next to the exe) and, right before launching VS Code, refresh it into ~/.vscode/extensions/garthvh.fauxclaude-status. So the local window always has the status-bar llama and it stays current as the extension changes — no manual copy. Best-effort; a running VS Code picks up the refresh on its next start. Verified both apps bundle the files; Windows compile-checked (0 errors). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 80918f7 commit 6169cd3

4 files changed

Lines changed: 48 additions & 0 deletions

File tree

mac-app/build-app.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ cp ../server.mjs ../dashboard.html "$APP/Contents/Resources/"
1313
if [ -f ../assets/logo.png ]; then mkdir -p "$APP/Contents/Resources/assets"; cp ../assets/logo.png ../assets/llama.png ../assets/favicon.png ../assets/favicon.ico "$APP/Contents/Resources/assets/"; fi
1414
cp ../assets/menubar-llama.png ../assets/menubar-llama-dim.png "$APP/Contents/Resources/" 2>/dev/null || true
1515
cp ../assets/FauxClaude.icns "$APP/Contents/Resources/" 2>/dev/null || true
16+
# bundle the VS Code status extension so the app can install it before launching VS Code
17+
[ -d ../vscode-extension ] && cp -R ../vscode-extension "$APP/Contents/Resources/vscode-extension" || true
1618
codesign --force -s - "$APP"
1719

1820
echo "Built: $(cd "$(dirname "$APP")" && pwd)/FauxClaude.app"

mac-app/main.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ final class ShimController: ObservableObject {
185185
NSApp.activate(ignoringOtherApps: true)
186186
guard panel.runModal() == .OK, let folder = panel.url else { return }
187187

188+
installStatusExtension() // keep the status-bar llama present & up to date
189+
188190
let vscode = "/Applications/Visual Studio Code.app/Contents/MacOS/Electron"
189191
guard FileManager.default.isExecutableFile(atPath: vscode) else {
190192
alert("VS Code not found",
@@ -207,6 +209,20 @@ final class ShimController: ObservableObject {
207209
}
208210
}
209211

212+
// Copy the bundled FauxClaude Status extension into VS Code's shared extensions
213+
// dir (refreshing it), so the local window always shows the status-bar llama.
214+
// Best-effort; a running VS Code picks it up on its next start.
215+
private func installStatusExtension() {
216+
let fm = FileManager.default
217+
guard let src = Bundle.main.resourceURL?.appendingPathComponent("vscode-extension"),
218+
fm.fileExists(atPath: src.path) else { return }
219+
let dest = fm.homeDirectoryForCurrentUser
220+
.appendingPathComponent(".vscode/extensions/garthvh.fauxclaude-status")
221+
try? fm.createDirectory(at: dest.deletingLastPathComponent(), withIntermediateDirectories: true)
222+
try? fm.removeItem(at: dest)
223+
try? fm.copyItem(at: src, to: dest)
224+
}
225+
210226
func openLog() {
211227
NSWorkspace.shared.open(logURL)
212228
}

windows-app/FauxClaude.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
<Content Include="..\assets\logo.png" Link="assets\logo.png" CopyToOutputDirectory="PreserveNewest" />
2626
<Content Include="..\assets\favicon.png" Link="assets\favicon.png" CopyToOutputDirectory="PreserveNewest" />
2727
<Content Include="..\assets\favicon.ico" Link="assets\favicon.ico" CopyToOutputDirectory="PreserveNewest" />
28+
<!-- VS Code status extension, installed into ~/.vscode/extensions before launch -->
29+
<Content Include="..\vscode-extension\**" LinkBase="vscode-extension" CopyToOutputDirectory="PreserveNewest" />
2830
</ItemGroup>
2931

3032
</Project>

windows-app/Program.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,8 @@ private void OpenVSCode()
307307
return;
308308
}
309309

310+
InstallStatusExtension(); // keep the status-bar llama present & up to date
311+
310312
// Reused profile (outside any project) so it's an isolated instance that
311313
// stays pointed local and isn't a blank session each time.
312314
var profile = Path.Combine(lad, "fauxclaude", "vscode-profile");
@@ -326,6 +328,32 @@ private void OpenVSCode()
326328
catch (Exception ex) { MessageBox.Show($"Couldn't open VS Code:\n{ex.Message}", "FauxClaude"); }
327329
}
328330

331+
// Copy the bundled FauxClaude Status extension into VS Code's shared extensions
332+
// dir (refreshing it) so the local window always shows the status-bar llama.
333+
// Best-effort; a running VS Code picks it up on its next start.
334+
private static void InstallStatusExtension()
335+
{
336+
var src = Path.Combine(AppContext.BaseDirectory, "vscode-extension");
337+
if (!Directory.Exists(src)) return;
338+
var dest = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
339+
".vscode", "extensions", "garthvh.fauxclaude-status");
340+
try
341+
{
342+
if (Directory.Exists(dest)) Directory.Delete(dest, recursive: true);
343+
CopyDir(src, dest);
344+
}
345+
catch { /* best effort */ }
346+
}
347+
348+
private static void CopyDir(string src, string dest)
349+
{
350+
Directory.CreateDirectory(dest);
351+
foreach (var f in Directory.GetFiles(src))
352+
File.Copy(f, Path.Combine(dest, Path.GetFileName(f)), overwrite: true);
353+
foreach (var d in Directory.GetDirectories(src))
354+
CopyDir(d, Path.Combine(dest, Path.GetFileName(d)));
355+
}
356+
329357
// ---- Ollama parallelism ------------------------------------------------
330358

331359
private static int ReadParallel()

0 commit comments

Comments
 (0)