update mods

This commit is contained in:
2026-02-12 01:34:38 +08:00
parent 814cc26430
commit fa4648ebb0
2 changed files with 39 additions and 16 deletions

View File

@@ -675,7 +675,7 @@ class Logger {
_debug: boolean = false;
constructor() {
this._debug = osEnv("LOGGER") === '*';
this._debug = osEnv("LOGGER") === "*";
}
// deno-lint-ignore no-explicit-any
@@ -960,8 +960,11 @@ export function encodeBase64Url(
export async function getKeyRingPassword(
service: string,
user: string,
): string | null {
const keyRingArgs = ["-g", "--json", "-S", service, "-U", user];
): Promise<string | null> {
const keyRingArgs = ["-g", "--json", "-U", user];
if (service) {
keyRingArgs.push(...["-S", service]);
}
const processOutput = await execCommand("keyring.rs", keyRingArgs);
const stdoutString = processOutput.getStdoutAsStringThenTrim();
const stderrString = processOutput.getStderrAsStringThenTrim();
@@ -983,8 +986,11 @@ export async function setKeyRingPassword(
service: string,
user: string,
password: string,
): void {
const keyRingArgs = ["-s", "-S", service, "-U", user, "-P", password];
): Promise<void> {
const keyRingArgs = ["-s", "-U", user, "-P", password];
if (service) {
keyRingArgs.push(...["-S", service]);
}
const processOutput = await execCommand("keyring.rs", keyRingArgs);
const stdoutString = processOutput.getStdoutAsStringThenTrim();
const stderrString = processOutput.getStderrAsStringThenTrim();