MCPcopy Create free account
hub / github.com/Railly/tinte / installFromFile

Method installFromFile

apps/web/tinte-cli.ts:109–127  ·  view source on GitHub ↗

* Install theme from local JSON file

(
    filePath: string,
    themeName?: string,
    options: EditorInstallOptions = {},
  )

Source from the content-addressed store, hash-verified

107 * Install theme from local JSON file
108 */
109 async installFromFile(
110 filePath: string,
111 themeName?: string,
112 options: EditorInstallOptions = {},
113 ): Promise<string> {
114 console.log(`📁 Loading theme from: ${filePath}`);
115
116 const fs = await import("node:fs/promises");
117 const fileContent = await fs.readFile(filePath, "utf-8");
118 const themeData = JSON.parse(fileContent);
119
120 const tinteTheme = themeData.rawTheme || themeData;
121 const name =
122 themeName || themeData.name || themeData.displayName || "Local Theme";
123 const vscodeOverrides =
124 themeData.vscode_overrides || themeData.overrides?.vscode;
125
126 return this.installTheme(tinteTheme, name, options, vscodeOverrides);
127 }
128
129 /**
130 * Quick install with theme shorthand

Callers 1

quickMethod · 0.95

Calls 1

installThemeMethod · 0.95

Tested by

no test coverage detected