Skip to content

Commit

Permalink
[tsp-client] Fix tool version (#8818)
Browse files Browse the repository at this point in the history
* fix tool version

* changelog

---------

Co-authored-by: Catalina Peralta <[email protected]>
  • Loading branch information
catalinaperalta and cperaltah authored Aug 12, 2024
1 parent 386cd36 commit 37ef13e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions tools/tsp-client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release

## 2024-08-12 - 0.11.2

- Fix `--version` flag. (#8814)

## 2024-08-08 - 0.11.1

- Removed `compare` command.
Expand Down
11 changes: 10 additions & 1 deletion tools/tsp-client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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", {
Expand Down

0 comments on commit 37ef13e

Please sign in to comment.