Fix the folder path of the Background measurement
realpath from node:fs/promises has no native form. Use realpathSync.native from node:fs.
This commit is contained in:
@@ -3,7 +3,8 @@
|
|||||||
// The tool starts a test build with an isolated identifier, drives it through CDP, and stops only the process tree that it started.
|
// The tool starts a test build with an isolated identifier, drives it through CDP, and stops only the process tree that it started.
|
||||||
// Run `node scripts/measureFeatures.mjs --help` for the arguments. The results go to output/phase-7/<stage>/.
|
// Run `node scripts/measureFeatures.mjs --help` for the arguments. The results go to output/phase-7/<stage>/.
|
||||||
import { existsSync } from "node:fs";
|
import { existsSync } from "node:fs";
|
||||||
import { mkdir, readFile, realpath, rm, writeFile } from "node:fs/promises";
|
import { realpathSync } from "node:fs";
|
||||||
|
import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
||||||
import os from "node:os";
|
import os from "node:os";
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import { setTimeout as sleep } from "node:timers/promises";
|
import { setTimeout as sleep } from "node:timers/promises";
|
||||||
@@ -57,7 +58,7 @@ async function seedBackgroundNative(folders, backgrounds) {
|
|||||||
const background = { source: "folder", seconds: TABLE.features.background.seconds, order: "name", paused: false, targets: ["app"], overlay: 0, position: "center", size: "cover" };
|
const background = { source: "folder", seconds: TABLE.features.background.seconds, order: "name", paused: false, targets: ["app"], overlay: 0, position: "center", size: "cover" };
|
||||||
await writeFile(path.join(folders.roaming, "settings.json"), JSON.stringify({ schema: 1, revision: 1, background }, null, 2) + "\n");
|
await writeFile(path.join(folders.roaming, "settings.json"), JSON.stringify({ schema: 1, revision: 1, background }, null, 2) + "\n");
|
||||||
// The host accepts the folder only at its resolved path.
|
// The host accepts the folder only at its resolved path.
|
||||||
await writeFile(path.join(folders.roaming, "background-folder.json"), JSON.stringify({ schema: 1, path: await realpath.native(backgrounds) }, null, 2));
|
await writeFile(path.join(folders.roaming, "background-folder.json"), JSON.stringify({ schema: 1, path: realpathSync.native(backgrounds) }, null, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The features that are on in the running app. */
|
/** The features that are on in the running app. */
|
||||||
|
|||||||
Reference in New Issue
Block a user