fix: bugs after multimonitor (#4680)

This commit is contained in:
Alireza authored and GitHub committed 2025-01-13 18:32:54 -05:00
1 parent 7662157cbf
commit c901a847af
5 files changed
+5 -254

No files matched your search

+4 -7
View File
@@ -218,7 +218,7 @@ export class CommandsManager {
* @param options - to include in the commands run beyond
* the commandOptions specified in the base.
*/
public run(input: RunInput, options: Record<string, unknown> = {}): unknown[] {
public run(input: RunInput, options: Record<string, unknown> = {}): unknown {
const commands = this.validate(input, options);
const results: unknown[] = [];
@@ -228,14 +228,11 @@ export class CommandsManager {
results.push(this.runCommand(commandName, commandOptions, context));
}
return results;
return results.length === 1 ? results[0] : results;
}
/** Like run, but await each command before continuing */
public async runAsync(
input: RunInput,
options: Record<string, unknown> = {}
): Promise<unknown[]> {
public async runAsync(input: RunInput, options: Record<string, unknown> = {}): Promise<unknown> {
const commands = this.validate(input, options);
const results: unknown[] = [];
@@ -245,7 +242,7 @@ export class CommandsManager {
results.push(await this.runCommand(commandName, commandOptions, context));
}
return results;
return results.length === 1 ? results[0] : results;
}
}