build: remove fs-extra devdep (#42708)
* build: remove fs-extra dependency from script/gen-filenames.ts * build: remove fs-extra dependency from script/spec-runner.js * build: remove fs-extra dependency from script/gn-asar.js * build: remove fs-extra dependency from spec/api-autoupdater-darwin-spec.ts * build: remove fs-extra dependency from spec/api-safe-storage-spec.ts * build: remove fs-extra dependency from spec/lib/codesign-helpers.ts * build: remove fs-extra dependency from spec/api-app-spec.ts * build: remove fs-extra dependency from spec/esm-spec.ts * build: remove fs-extra dependency from spec/lib/fs-helpers.ts * build: remove fs-extra dependency from spec/lib/api-shell-spec.ts * build: remove fs-extra dependency from spec/api-context-bridge-spec.ts * build: remove fs-extra dependency from spec/asar-integrity-spec.ts * build: remove fs-extra dependency from spec/node-spec.ts * build: remove fs-extra devdiv * fixup! build: remove fs-extra dependency from spec/api-context-bridge-spec.ts * fix: use force: true when removing directories * chore: reduce diffs to main Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
parent
2c3a9fd3c5
commit
e480e29cfc
15 changed files with 55 additions and 80 deletions
|
@ -1,6 +1,5 @@
|
|||
import * as cp from 'node:child_process';
|
||||
import * as fs from 'original-fs';
|
||||
import * as fsExtra from 'fs-extra';
|
||||
import * as os from 'node:os';
|
||||
import * as path from 'node:path';
|
||||
|
||||
|
@ -20,7 +19,7 @@ export async function copyApp (targetDir: string): Promise<string> {
|
|||
const filesToCopy = (fs.readFileSync(zipManifestPath, 'utf-8')).split('\n').filter(f => f !== 'LICENSE' && f !== 'LICENSES.chromium.html' && f !== 'version' && f.trim());
|
||||
await Promise.all(
|
||||
filesToCopy.map(async rel => {
|
||||
await fsExtra.mkdirp(path.dirname(path.resolve(targetDir, rel)));
|
||||
await fs.promises.mkdir(path.dirname(path.resolve(targetDir, rel)), { recursive: true });
|
||||
fs.copyFileSync(path.resolve(baseDir, rel), path.resolve(targetDir, rel));
|
||||
})
|
||||
);
|
||||
|
@ -29,7 +28,7 @@ export async function copyApp (targetDir: string): Promise<string> {
|
|||
}
|
||||
|
||||
export async function withTempDirectory (fn: (dir: string) => Promise<void>, autoCleanUp = true) {
|
||||
const dir = await fsExtra.mkdtemp(path.resolve(os.tmpdir(), 'electron-update-spec-'));
|
||||
const dir = await fs.promises.mkdtemp(path.resolve(os.tmpdir(), 'electron-update-spec-'));
|
||||
try {
|
||||
await fn(dir);
|
||||
} finally {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue