Skip to content

Commit 38b2c04

Browse files
author
Ovidiu Barabula
committed
feat(core): improve task manager run method implementation
1 parent 8029051 commit 38b2c04

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/task-manager/index.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,16 @@ function TaskManager(options?: TaskManagerOptions): TaskManager {
5454
* @param hook Name of the hook
5555
*/
5656
function run(hook: string): Promise<boolean> {
57-
return new Promise((resolve, reject) => {
58-
const onError = (error?: Error) => reject(error || false);
59-
60-
if (hasTasks(hook)) {
61-
gulp.parallel(tasks[hook])(onError);
62-
return resolve(true);
63-
}
64-
57+
// If not tasks in hook, return false
58+
if (!hasTasks(hook)) {
6559
logger.warn(`<${hook}> hook doesn't exist or has no tasks`);
66-
return resolve(false);
60+
return Promise.resolve(false);
61+
}
62+
63+
return new Promise((resolve, reject) => {
64+
gulp.series(gulp.parallel(tasks[hook]), () => resolve(true))(
65+
/* istanbul ignore next */ ignore => undefined,
66+
);
6767
});
6868
}
6969

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy