Skip to content

Commit

Permalink
app: Remove fs-extra dependency
Browse files Browse the repository at this point in the history
It seems we don't need it for the functions we are using in there.
The node:fs module already can do these things.

Signed-off-by: René Dudfield <renedudfield@microsoft.com>
  • Loading branch information
illume committed Jul 15, 2024
1 parent 0cd7ecf commit ea2702e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import {
} from 'electron';
import { IpcMainEvent, MenuItemConstructorOptions } from 'electron/main';
import find_process from 'find-process';
import fs from 'fs';
import { spawnSync } from 'node:child_process';
import fs from 'node:fs';
import { userInfo } from 'node:os';
import path from 'path';
import url from 'url';
Expand Down
1 change: 0 additions & 1 deletion app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@
"@electron/notarize": "^2.1.0",
"electron": "^31.2.0",
"electron-builder": "^24.13.3",
"fs-extra": "^8.1.0",
"i18next-parser": "^9.0.0",
"jest": "^29.7.0",
"mime-types": "^2.1.35",
Expand Down
8 changes: 4 additions & 4 deletions app/scripts/after-pack.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const fse = require('fs-extra');
const fs = require('node:fs');
const path = require('path');

// This is a needed workaround because electron-builder is discarding the
Expand All @@ -13,15 +13,15 @@ exports.default = async context => {
}

try {
fse.copySync('./prod_deps/node_modules', dest);
fs.copySync('./prod_deps/node_modules', dest);
} catch (err) {
console.error('Failed to copy node_modules after pack:', err);
}

if (fse.existsSync('.env')) {
if (fs.existsSync('.env')) {
console.info('Copying .env file to app resources directory!');
try {
fse.copySync('./.env', path.join(context.appOutDir, 'resources', '.env'));
fs.copySync('./.env', path.join(context.appOutDir, 'resources', '.env'));
} catch (err) {
console.error('Failed to copy .env after pack:', err);
}
Expand Down

0 comments on commit ea2702e

Please sign in to comment.