This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require("path"); | |
const fs = require("fs"); | |
const { app } = require("electron"); | |
const sqlite3 = require("sqlite3").verbose(); | |
// Build the database path and output to the console | |
const appDataPath = app.getPath("appData"); | |
const databasePath = path.join(appDataPath, "database.sqlite"); | |
console.log(`Database Path: ${databasePath}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios, { AxiosError } from "axios"; | |
const WebApi: any = axios.create({ | |
headers: { | |
'Content-Type': "application/json", | |
'Accept': "application/json", | |
} | |
}); | |
const PublicApi: any = axios.create({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { exec } = require("child_process"); | |
const appPath = process.env.PATH.split(";").filter((segment) => segment.trim().length > 0).filter((segment) => segment.indexOf("node_modules") > -1); | |
export function getVar(variable, callback){ | |
exec(`echo %${variable}%`, (err, stdOut, stdErr) => { | |
if(err == null){ | |
if(callback){ | |
callback(stdOut); | |
} |