fix env var loading

This commit is contained in:
Jeffrey Morgan
2023-07-07 10:27:16 -04:00
parent ad84138469
commit 7974ad58ff
5 changed files with 15 additions and 7 deletions

View File

@@ -1,13 +1,15 @@
import { Analytics } from '@segment/analytics-node'
import { v4 as uuidv4 } from 'uuid'
import Store from 'electron-store'
const Store = require('electron-store')
const store = new Store()
console.log(process.env)
export const analytics = new Analytics({ writeKey: process.env.TELEMETRY_WRITE_KEY || '<empty>' })
export function id(): string {
const id = store.get('id')
const id = store.get('id') as string
if (id) {
return id