diff --git a/__test__/edge_api.test.ts b/__test__/edge_api.test.ts index 6c8ac6f..53fb19e 100644 --- a/__test__/edge_api.test.ts +++ b/__test__/edge_api.test.ts @@ -8,7 +8,7 @@ describe("EdgeUpdates", () => { beforeEach(async () => { const content = await fs.promises.readFile( path.join(__dirname, "./testdata.json"), - "utf-8" + "utf-8", ); updates = new EdgeUpdates(JSON.parse(content)); }); @@ -28,7 +28,7 @@ describe("EdgeUpdatesProduct", () => { beforeEach(async () => { const content = await fs.promises.readFile( path.join(__dirname, "./testdata.json"), - "utf-8" + "utf-8", ); updates = new EdgeUpdates(JSON.parse(content)); }); @@ -62,7 +62,7 @@ describe("EdgeUpdatesProductRelease", () => { beforeEach(async () => { const content = await fs.promises.readFile( path.join(__dirname, "./testdata.json"), - "utf-8" + "utf-8", ); updates = new EdgeUpdates(JSON.parse(content)); }); diff --git a/src/edge_api.ts b/src/edge_api.ts index 7d4b32c..eb542b4 100644 --- a/src/edge_api.ts +++ b/src/edge_api.ts @@ -78,7 +78,7 @@ export class EdgeUpdatesProduct { const release = this.json.Releases.find( (r) => r.Platform === platformValue && - (r.Architecture == "universal" || r.Architecture === archValue) + (r.Architecture == "universal" || r.Architecture === archValue), ); if (release) { return new EdgeUpdatesProductRelease(release); @@ -113,12 +113,12 @@ export class EdgeUpdatesClient { const resp = await http.getJson(url); if (resp.statusCode !== httpm.HttpCodes.OK) { throw new Error( - `Failed to get latest version: server returns ${resp.statusCode}` + `Failed to get latest version: server returns ${resp.statusCode}`, ); } if (resp.result === null) { throw new Error( - "Failed to get latest version: server returns empty body" + "Failed to get latest version: server returns empty body", ); } return new EdgeUpdates(resp.result); diff --git a/src/installer_linux.ts b/src/installer_linux.ts index 6e2aea7..decacad 100644 --- a/src/installer_linux.ts +++ b/src/installer_linux.ts @@ -16,7 +16,7 @@ export class LinuxInstaller implements Installer { constructor(private readonly platform: Platform) {} async checkInstalled( - version: versions.Version + version: versions.Version, ): Promise { const root = tc.find("msedge", version); if (root) { @@ -33,17 +33,17 @@ export class LinuxInstaller implements Installer { const product = productVersions.getReleaseByPlatform(this.platform); if (!product) { throw new Error( - `Unsupported platform: ${this.platform.os} ${this.platform.arch}` + `Unsupported platform: ${this.platform.os} ${this.platform.arch}`, ); } const artifact = product.getPreferredArtifact(); if (!artifact) { throw new Error( - `Artifact not found of Edge ${version} for platform ${this.platform.os} ${this.platform.arch}` + `Artifact not found of Edge ${version} for platform ${this.platform.os} ${this.platform.arch}`, ); } core.info( - `Acquiring ${version} (${product.ProductVersion}) from ${artifact.Location}` + `Acquiring ${version} (${product.ProductVersion}) from ${artifact.Location}`, ); const archive = await tc.downloadTool(artifact.Location); @@ -52,7 +52,7 @@ export class LinuxInstaller implements Installer { async install( version: versions.Version, - archive: string + archive: string, ): Promise { const tmpdir = await fs.promises.mkdtemp(path.join(os.tmpdir(), "deb-")); const extdir = await fs.promises.mkdtemp(path.join(os.tmpdir(), "msedge-")); diff --git a/src/installer_mac.ts b/src/installer_mac.ts index 4eea7e8..154803d 100644 --- a/src/installer_mac.ts +++ b/src/installer_mac.ts @@ -16,7 +16,7 @@ export class MacInstaller implements Installer { constructor(private readonly platform: Platform) {} async checkInstalled( - version: versions.Version + version: versions.Version, ): Promise { const root = tc.find("msedge", version); if (root) { @@ -34,19 +34,19 @@ export class MacInstaller implements Installer { const product = productVersions.getReleaseByPlatform(this.platform); if (!product) { throw new Error( - `Unsupported platform: ${this.platform.os} ${this.platform.arch}` + `Unsupported platform: ${this.platform.os} ${this.platform.arch}`, ); } const artifact = product.getPreferredArtifact(); if (!artifact) { throw new Error( - `Artifact not found of Edge ${version} for platform ${this.platform.os} ${this.platform.arch}` + `Artifact not found of Edge ${version} for platform ${this.platform.os} ${this.platform.arch}`, ); } artifact.Location; core.info( - `Acquiring ${version} (${product.ProductVersion}) from ${artifact.Location}` + `Acquiring ${version} (${product.ProductVersion}) from ${artifact.Location}`, ); const archive = await tc.downloadTool(artifact.Location); @@ -55,14 +55,14 @@ export class MacInstaller implements Installer { async install( version: versions.Version, - archive: string + archive: string, ): Promise { const extdir = await fs.promises.mkdtemp(path.join(os.tmpdir(), "msedge-")); // /tmp/msedge-xxxxxx/ await exec.exec("xar", ["-xf", archive], { cwd: extdir }); const pkgdir = (await fs.promises.readdir(extdir)).filter( - (e) => e.startsWith("MicrosoftEdge") && e.endsWith(".pkg") + (e) => e.startsWith("MicrosoftEdge") && e.endsWith(".pkg"), )[0]; if (!pkgdir) { throw new Error('"MicrosoftEdge*.pkg" not found in extracted archive'); @@ -71,7 +71,7 @@ export class MacInstaller implements Installer { await fs.promises.rename( path.join(pkgroot, "Payload"), - path.join(pkgroot, "App.gz") + path.join(pkgroot, "App.gz"), ); await exec.exec("gzip", ["--decompress", "App.gz"], { cwd: pkgroot }); await exec.exec("cpio", ["--extract", "--file", "App"], { cwd: pkgroot }); diff --git a/src/installer_windows.ts b/src/installer_windows.ts index 7e56cc5..0219c6c 100644 --- a/src/installer_windows.ts +++ b/src/installer_windows.ts @@ -21,7 +21,7 @@ export class WindowsInstaller implements Installer { constructor(private readonly platform: Platform) {} async checkInstalled( - version: versions.Version + version: versions.Version, ): Promise { const root = this.rootDir(version); try { @@ -48,15 +48,15 @@ export class WindowsInstaller implements Installer { async install( version: versions.Version, - archive: string + archive: string, ): Promise { // Use a native API to kill the process. const p = cp.spawn(archive); p.stdout.on("data", (data: Buffer) => - process.stdout.write(data.toString()) + process.stdout.write(data.toString()), ); p.stderr.on("data", (data: Buffer) => - process.stderr.write(data.toString()) + process.stderr.write(data.toString()), ); // Do not wait for the installer, as an installer for windows requires an @@ -94,7 +94,7 @@ export class WindowsInstaller implements Installer { case versions.CanaryVersion: return path.join( os.homedir(), - "AppData\\Local\\Microsoft\\Edge SxS\\Application" + "AppData\\Local\\Microsoft\\Edge SxS\\Application", ); } } diff --git a/src/watch.ts b/src/watch.ts index e3e7147..8ffcf83 100644 --- a/src/watch.ts +++ b/src/watch.ts @@ -3,7 +3,7 @@ import fs from "fs"; export const waitInstall = ( path: string, timeoutSec: number = 10 * 60, - checkIntervalSec = 5 + checkIntervalSec = 5, ): Promise => { return new Promise((resolve, reject) => { const resetTimers = () => {