Skip to content
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

Set Default build task by default #4

Open
jacoues opened this issue Aug 29, 2019 · 4 comments
Open

Set Default build task by default #4

jacoues opened this issue Aug 29, 2019 · 4 comments

Comments

@jacoues
Copy link

jacoues commented Aug 29, 2019

In order to minimize the number of things to edit when I switch default build tasks. I found that putting "args": [${defaultBuildTask}] runs the default build task as defined in tasks.json. This means I only have to edit tasks.json in order to switch default build task.
Perhaps you could add that to your documentation?

@Gama11
Copy link
Member

Gama11 commented Aug 29, 2019

Interesting, I didn't know about that!

@Gama11
Copy link
Member

Gama11 commented Sep 1, 2019

"args": [${defaultBuildTask}] isn't valid syntax, so I assume you meant:

"args": ["${defaultBuildTask}"]

However, that doesn't seem to work:

@jacoues
Copy link
Author

jacoues commented Sep 4, 2019

You're right.. for some reason though, despite the invalid syntax it still runs the default task. Perhaps if the task is unspecified or invalid it runs the default build task?

@Gama11
Copy link
Member

Gama11 commented Sep 4, 2019

That's strange, that's not the case for me. It doesn't make sense when you look at the code either:

if (task == null) {
window.showErrorMessage('Could not find a task whose name matches \'$taskName\'.');
} else {
var runningTask = runningTasks.find(execution -> taskNameRegex.match(execution.task.name));
if (runningTask != null) {
runningTask.terminate();
}
tasks.executeTask(task);
}

The error is shown in the if, executeTask() is called in the else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants