Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Marius456 committed Jun 20, 2024
1 parent 3ac404f commit 9b038e7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/sdk-webos/src/deviceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ export const launchWebOSimulator = async (target: string | boolean) => {
const availableSimulatorVersions = getDirectories(path.join(webosSdkPath, 'Simulator'));

if (target === true) {
if(availableSimulatorVersions.length == 0){
return Promise.reject(`Simulators not found in the specified path: ${path.join(webosSdkPath, 'Simulator')}`);
if (availableSimulatorVersions.length === 0) {
return Promise.reject(
`Simulators not found in the specified path: ${path.join(webosSdkPath, 'Simulator')}`
);
}
const { selectedSimulator } = await inquirerPrompt({
name: 'selectedSimulator',
Expand All @@ -71,9 +73,9 @@ export const launchWebOSimulator = async (target: string | boolean) => {

if (c.isSystemWin || c.isSystemLinux) {
try {
await executeAsync(ePath, ExecOptionsPresets.SPINNER_FULL_ERROR_SUMMARY);
logSuccess(`successfully launched ${target}`);
return true;
await executeAsync(ePath, ExecOptionsPresets.SPINNER_FULL_ERROR_SUMMARY);
logSuccess(`successfully launched ${target}`);
return true;
} catch (error) {
return Promise.reject(`The Simulator can't be launched because it is already in use.`);
}
Expand Down

0 comments on commit 9b038e7

Please sign in to comment.