From b15630b211eb480373a697ca5197ee7212b12967 Mon Sep 17 00:00:00 2001 From: Hawtian Wang Date: Mon, 12 Feb 2024 00:15:33 +0800 Subject: [PATCH] fix --- lua/ht/version.lua | 2 +- src/core/model/ext_tool.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lua/ht/version.lua b/lua/ht/version.lua index f646d31a..910a58ea 100644 --- a/lua/ht/version.lua +++ b/lua/ht/version.lua @@ -1,5 +1,5 @@ local M = {} -M.last_updated_time = '2024.02.10' +M.last_updated_time = '2024.02.12' return M diff --git a/src/core/model/ext_tool.ts b/src/core/model/ext_tool.ts index ac3e4e3a..5b2c2e23 100644 --- a/src/core/model/ext_tool.ts +++ b/src/core/model/ext_tool.ts @@ -16,7 +16,7 @@ export interface LocalToolOpt { /** * Absolute path of tool. */ - command: string[]; + command: string[] | (() => any); } export interface AbsolutePathToolOpt { @@ -68,6 +68,9 @@ class ExternalTools implements ExternalToolsOpt { return this.name; } if ("command" in this.exe) { + if (typeof this.exe.command === "function") { + return this.exe.command(); + } return this.exe.command.join(" "); } else if ("masonPkg" in this.exe) { return `${HttsContext.getInstance().masonBinRoot}/${this.exe.masonPkg}`;