Skip to content

Commit

Permalink
fix resolve tasks manager (#982)
Browse files Browse the repository at this point in the history
* fix resolve tasks manager

* fix lint
  • Loading branch information
brianignacio5 authored Jun 15, 2023
1 parent 3c41028 commit 0118b81
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/taskManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
* Project: ESP-IDF VSCode Extension
* File Created: Friday, 27th September 2019 9:59:57 pm
* Copyright 2019 Espressif Systems (Shanghai) CO LTD
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -52,6 +52,7 @@ export class TaskManager {
return new Promise<void>((resolve, reject) => {
vscode.tasks.onDidEndTask((e) => {
if (
e.execution &&
e.execution.task.definition.taskId.indexOf(
newTask.definition.taskId
) !== -1
Expand Down Expand Up @@ -83,9 +84,13 @@ export class TaskManager {

public static async runTasks() {
return new Promise<void>(async (resolve, reject) => {
if (TaskManager.tasks.length === 0) {
return resolve();
}
let lastExecution = await vscode.tasks.executeTask(TaskManager.tasks[0]);
const taskDisposable = vscode.tasks.onDidEndTaskProcess(async (e) => {
if (
e.execution &&
e.execution.task.definition.taskId.indexOf(
lastExecution.task.definition.taskId
) !== -1
Expand Down

0 comments on commit 0118b81

Please sign in to comment.