Skip to content
This repository was archived by the owner on Nov 25, 2025. It is now read-only.

Commit c6f7955

Browse files
committed
Execute version commands from workspace
This allows the use of tools like [anyzig](https://github.com/marler8997/anyzig), which use the version configured in the directory.
1 parent 1e34279 commit c6f7955

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/zigUtil.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,11 @@ export function getVersion(
210210
arg: string,
211211
): semver.SemVer | null {
212212
try {
213-
const buffer = childProcess.execFileSync(filePath, [arg]);
213+
const wsFolder = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath;
214+
const buffer = childProcess.execFileSync(filePath, [arg], { cwd: wsFolder });
214215
const versionString = buffer.toString("utf8").trim();
215216
if (versionString === "0.2.0.83a2a36a") {
216-
// Zig 0.2.0 reports the verion in a non-semver format
217+
// Zig 0.2.0 reports the version in a non-semver format
217218
return semver.parse("0.2.0");
218219
}
219220
return semver.parse(versionString);

0 commit comments

Comments
 (0)