From 25e71927f807b92f03937b7aaf1f1d1887be74ea Mon Sep 17 00:00:00 2001 From: fan xia Date: Fri, 20 Oct 2023 03:18:23 +0800 Subject: [PATCH] lnk parse --- src/sysapp/index.ts | 3 ++- src/sysapp/windows.ts | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sysapp/index.ts b/src/sysapp/index.ts index 3658d29..6684fe2 100644 --- a/src/sysapp/index.ts +++ b/src/sysapp/index.ts @@ -1,10 +1,11 @@ import { shortcutWin } from "./windows" import { platform } from "os" import { exeLookBase64 } from "../../addon" +import { ParsedPath } from "path"; export type CallBack = (app: App) => void | Promise -export interface App { +export interface App extends ParsedPath { name: string; description: string; execPath: string; diff --git a/src/sysapp/windows.ts b/src/sysapp/windows.ts index 251c776..d9495fe 100644 --- a/src/sysapp/windows.ts +++ b/src/sysapp/windows.ts @@ -8,10 +8,9 @@ export const shortcutWin = async (callback: CallBack, extraPath: string[] = []) const hdir = homedir() const f = new fdir().glob("./**/*.lnk").withFullPaths() .filter((t) => { - const { name } = parse(t) const d = parseLnk(t) callback({ - name, + ...parse(t), description: d.nameString, execPath: d.fullPath, shortCutPath: t,