Skip to content

Commit 92c7acc

Browse files
misc: Fix new eslint warnings
1 parent 5f1914d commit 92c7acc

File tree

3 files changed

+15
-20
lines changed

3 files changed

+15
-20
lines changed

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ class Extension {
155155
}
156156

157157
// eslint-disable-next-line @typescript-eslint/no-explicit-any
158-
private registerCommand(name: string, callback: (...args: any) => any | Promise<void>) {
158+
private registerCommand(name: string, callback: (...args: any) => Promise<void>) {
159159
this.extCtx.subscriptions.push(
160160
commands.registerCommand(`${EXTENSION_ID}.${name}`, async (args) => {
161161
try {

src/manifest.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import * as vscode from 'vscode'
22
import { BuildOptionsPathKeys, ManifestSchema, Module, SdkExtension } from './flatpak.types'
33
import * as path from 'path'
4-
import { getuid } from 'process'
54
import { cpus } from 'os'
65
import * as fs from 'fs/promises'
76
import { Command } from './command'
@@ -576,7 +575,7 @@ export class Manifest {
576575
}
577576

578577
async runInRepo(shellCommand: string, mountExtensions: boolean, additionalEnvVars?: Map<string, string>): Promise<Command> {
579-
const uid = getuid()
578+
const uid = process.geteuid ? process.geteuid() : 1000
580579
const appId = this.id()
581580
if (this.fontsArgs.length === 0) {
582581
this.fontsArgs = await getFontsArgs()

src/test/suite/index.ts

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,22 @@ export function run(): Promise<void> {
1212
const testsRoot = path.resolve(__dirname, '..')
1313

1414
return new Promise((c, e) => {
15-
glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {
16-
if (err) {
17-
return e(err)
18-
}
15+
try {
16+
const files = glob.globSync('**/**.test.js', { cwd: testsRoot })
1917

2018
// Add files to the test suite
2119
files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f)))
2220

23-
try {
24-
// Run the mocha test
25-
mocha.run((failures) => {
26-
if (failures > 0) {
27-
e(new Error(`${failures} tests failed.`))
28-
} else {
29-
c()
30-
}
31-
})
32-
} catch (err) {
33-
e(err)
34-
}
35-
})
21+
// Run the mocha test
22+
mocha.run((failures) => {
23+
if (failures > 0) {
24+
e(new Error(`${failures} tests failed.`))
25+
} else {
26+
c()
27+
}
28+
})
29+
} catch (err) {
30+
e(err)
31+
}
3632
})
3733
}

0 commit comments

Comments
 (0)