Skip to content

Run the task version command in the workspace root folder #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/services/taskfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,11 @@ class TaskfileService {
}
return await new Promise((resolve) => {
let command = this.command('--version');
cp.exec(command, (_, stdout: string, stderr: string) => {
// Determine the root of the working directory of the project
let workspaceFolders = vscode.workspace.workspaceFolders;
let cwd = workspaceFolders && workspaceFolders.length > 0 ? workspaceFolders[0].uri.fsPath : undefined;

cp.exec(command, { cwd }, (_, stdout: string, stderr: string) => {
// If the version is a devel version, ignore all version checks
if (stdout.includes("devel")) {
log.info("Using development version of task");
Expand Down