MCPcopy Create free account
hub / github.com/Work-Fisher/code-claw / loadProductMeta

Function loadProductMeta

desktop/main.mjs:31–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29}
30
31async function loadProductMeta() {
32 if (productMeta) {
33 return productMeta
34 }
35
36 try {
37 const raw = await readFile(packageJsonPath, 'utf8')
38 const pkg = JSON.parse(raw)
39 productMeta = {
40 productName: app.getName() || pkg.productName || 'claw-code',
41 version: app.getVersion() || pkg.version || '0.1.0',
42 description:
43 pkg.description || 'Desktop launcher for the local claw-code runtime.',
44 electronVersion: process.versions.electron || '',
45 nodeVersion: process.versions.node || '',
46 chromeVersion: process.versions.chrome || '',
47 platform: `${process.platform} ${process.arch}`,
48 launcherUrl: uiUrl,
49 userDataPath: app.getPath('userData'),
50 }
51 } catch {
52 productMeta = {
53 productName: app.getName() || 'claw-code',
54 version: app.getVersion() || '0.1.0',
55 description: 'Desktop launcher for the local claw-code runtime.',
56 electronVersion: process.versions.electron || '',
57 nodeVersion: process.versions.node || '',
58 chromeVersion: process.versions.chrome || '',
59 platform: `${process.platform} ${process.arch}`,
60 launcherUrl: uiUrl,
61 userDataPath: app.getPath('userData'),
62 }
63 }
64
65 return productMeta
66}
67
68function sendAppCommand(command) {
69 if (!mainWindow || mainWindow.isDestroyed()) {

Callers 2

createMainWindowFunction · 0.85
registerIpcFunction · 0.85

Calls 2

readFileFunction · 0.85
parseMethod · 0.45

Tested by

no test coverage detected