From 29b05f63b06e50147221ab581f178f123acb1e89 Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Fri, 9 Aug 2024 17:31:57 -0700 Subject: [PATCH 1/2] fix tool version --- tools/tsp-client/src/index.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/tsp-client/src/index.ts b/tools/tsp-client/src/index.ts index feb82cab6b8..e6d7d20c059 100644 --- a/tools/tsp-client/src/index.ts +++ b/tools/tsp-client/src/index.ts @@ -10,8 +10,15 @@ import { syncCommand, updateCommand, } from "./commands.js"; -import { normalizePath, resolvePath } from "@typespec/compiler"; +import { joinPaths, normalizePath, resolvePath } from "@typespec/compiler"; import PromptSync from "prompt-sync"; +import { readFile } from "fs/promises"; +import { fileURLToPath } from "url"; +import { dirname } from "path"; + +const __dirname = dirname(fileURLToPath(import.meta.url)); + +const { version } = JSON.parse(await readFile(joinPaths(__dirname, "..", "package.json"), "utf8")); function commandPreamble(argv: any) { checkDebugLogging(argv); @@ -49,6 +56,8 @@ export function resolveOutputDir(argv: any): string { } const parser = yargs(hideBin(process.argv)) + .version(version) + .alias("v", "version") .scriptName("") .usage(usageText) .option("debug", { From fe08500ee1fb37e6c705387c43102ecb893481ce Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Fri, 9 Aug 2024 17:47:44 -0700 Subject: [PATCH 2/2] changelog --- tools/tsp-client/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/tsp-client/CHANGELOG.md b/tools/tsp-client/CHANGELOG.md index c46e5cce146..74d0aff334a 100644 --- a/tools/tsp-client/CHANGELOG.md +++ b/tools/tsp-client/CHANGELOG.md @@ -1,5 +1,9 @@ # Release +## 2024-08-12 - 0.11.2 + +- Fix `--version` flag. (#8814) + ## 2024-08-08 - 0.11.1 - Removed `compare` command.