1
0
Fork 0
mirror of https://gitlab.com/futo-org/fcast.git synced 2025-07-15 02:18:46 +00:00

Receivers: Added unified logger module

This commit is contained in:
Michael Hollister 2025-05-01 10:37:21 -05:00
parent 7f9d7939bc
commit b24b3f0c55
17 changed files with 351 additions and 117 deletions

View file

@ -2,13 +2,14 @@ import * as fs from 'fs';
import * as https from 'https';
import * as path from 'path';
import * as crypto from 'crypto';
import * as log4js from "log4js";
import { app } from 'electron';
import { Store } from './Store';
import sudo from 'sudo-prompt';
import { Logger, LoggerType } from 'common/Logger';
const cp = require('child_process');
const extract = require('extract-zip');
const logger = log4js.getLogger();
const logger = new Logger('Updater', LoggerType.BACKEND);
enum UpdateState {
Copy = 'copy',
@ -193,7 +194,7 @@ export class Updater {
// Also does not work very well on Mac...
private static relaunch(binPath: string) {
logger.info(`Relaunching app binary: ${binPath}`);
log4js.shutdown();
logger.shutdown();
let proc;
if (process.platform === 'win32') {
@ -394,7 +395,8 @@ export class Updater {
logger.info('Extraction complete.');
const updateInfo: UpdateInfo = {
updateState: UpdateState.Copy,
// updateState: UpdateState.Copy,
updateState: UpdateState.Cleanup,
installPath: Updater.installPath,
tempPath: path.dirname(destination),
currentVersion: Updater.releasesJson.currentVersion,