Skip to content

Commit f827c48

Browse files
authored
fix(cli): unexpected error on target device list (#8015)
1 parent c030354 commit f827c48

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cli/src/util/native-run.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { dirname } from 'path';
33
import c from '../colors';
44
import type { PlatformTarget } from '../common';
55
import { fatal } from '../errors';
6+
import { logger } from '../log';
67

78
import { resolveNode } from './node';
89
import { runCommand } from './subprocess';
@@ -40,6 +41,12 @@ export async function getPlatformTargets(platformName: string): Promise<Platform
4041
const err = JSON.parse(e);
4142
errors.push(err);
4243
}
44+
45+
if (errors.length === 0) {
46+
logger.info('No devices found.');
47+
return [];
48+
}
49+
4350
const plural = errors.length > 1 ? 's' : '';
4451
const errMsg = `${c.strong('native-run')} failed with error${plural}\n
4552
${errors

0 commit comments

Comments
 (0)