Skip to content
Snippets Groups Projects
Unverified Commit 9f72b438 authored by Michael Clark's avatar Michael Clark Committed by GitHub
Browse files

:electron: Remove unneded files (#3014)

parent ec3475d8
No related branches found
No related tags found
No related merge requests found
...@@ -24,8 +24,6 @@ import { ...@@ -24,8 +24,6 @@ import {
listen as listenToWindowState, listen as listenToWindowState,
} from './window-state'; } from './window-state';
import './setRequireHook';
import './security'; import './security';
Module.globalPaths.push(__dirname + '/..'); Module.globalPaths.push(__dirname + '/..');
......
...@@ -3,8 +3,6 @@ import Module from 'module'; ...@@ -3,8 +3,6 @@ import Module from 'module';
// @ts-strict-ignore // @ts-strict-ignore
import fetch from 'node-fetch'; import fetch from 'node-fetch';
import './setRequireHook';
Module.globalPaths.push(__dirname + '/..'); Module.globalPaths.push(__dirname + '/..');
global.fetch = fetch; global.fetch = fetch;
......
require.extensions['.electron.js'] = function (module, filename) {
return require.extensions['.js'](module, filename);
};
const { execSync } = require('child_process');
const {
SIGN_TOOL_PATH = 'C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64\\signtool.exe',
TIMESTAMP_SERVER = 'http://timestamp.digicert.com',
} = process.env;
const SITE = 'https://actualbudget.com/';
const importPfx = (certPath, password) => {
/* eslint-disable rulesdir/typography */
const command = [
['certutil'],
['-f'],
['-p', `"${password}"`],
['-importPfx', 'My', `"${certPath}"`, 'NoRoot'],
]
.map(sub => sub.join(' '))
.join(' ');
/* eslint-enable rulesdir/typography */
try {
execSync(command, { stdio: 'inherit' });
} catch {
console.error('Unable to import certificate');
}
};
const signBinary = (path, name) => {
/* eslint-disable rulesdir/typography */
const command = [
[`"${SIGN_TOOL_PATH}"`],
['sign'],
['/a'],
['/s', 'My'],
['/sm'],
['/t', `"${TIMESTAMP_SERVER}"`],
['/d', `"${name}"`],
['/du', `"${SITE}"`],
[`"${path}"`],
]
.map(sub => sub.join(' '))
.join(' ');
/* eslint-enable rulesdir/typography */
try {
execSync(command, { stdio: 'inherit' });
} catch {
console.error(`Signing ${path} failed`);
}
};
exports.default = ({ path, name, cscInfo: { file, password } = {} }) => {
if (!file) return;
importPfx(file, password);
signBinary(path, name, file);
};
---
category: Maintenance
authors: [MikesGlitch]
---
Remove unused files from Electron app
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment