feat: enhance application type definitions and improve app management logic

This commit is contained in:
Elysia
2026-01-31 17:48:06 +08:00
parent 3221cb6d5e
commit 39e40ff946
9 changed files with 86 additions and 27 deletions

View File

@@ -4,6 +4,8 @@ import readline from 'node:readline';
import { promisify } from 'node:util';
import pino from 'pino';
import { InstalledAppInfo } from '../../typedefinition';
const logger = pino({ 'name': 'install-manager' });
type InstallTask = {
@@ -66,7 +68,7 @@ const runCommandCapture = async (execCommand: string, execParams: string[]) => {
};
const parseInstalledList = (output: string) => {
const apps: Array<{ pkgname: string; version: string; arch: string; flags: string; raw: string }> = [];
const apps: Array<InstalledAppInfo> = [];
const lines = output.split('\n');
for (const line of lines) {
const trimmed = line.trim();

View File

@@ -0,0 +1,7 @@
export interface InstalledAppInfo {
pkgname: string;
version: string;
arch: string;
flags: string;
raw: string;
}