Skip to content

Commit 0b6071a

Browse files
alan-agius4dgp1130
authored andcommitted
fix(@angular/cli): ng doc does open browser on Windows
Wait until the browser has been launched before exiting the Node.js process. For more about this change see the explanation #22257 (comment) Closes #22257
1 parent d111ade commit 0b6071a

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

packages/angular/cli/commands/doc-impl.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,13 @@ export class DocCommand extends Command<DocCommandSchema> {
4040
/* eslint-disable-next-line import/no-extraneous-dependencies */
4141
const currentNgVersion = (await import('@angular/core')).VERSION.major;
4242
domain = `v${currentNgVersion}.angular.io`;
43-
} catch (e) {}
43+
} catch {}
4444
}
4545

46-
let searchUrl = `https://${domain}/api?query=${options.keyword}`;
47-
48-
if (options.search) {
49-
searchUrl = `https://${domain}/docs?search=${options.keyword}`;
50-
}
51-
52-
await open(searchUrl, {
53-
wait: false,
54-
});
46+
await open(
47+
options.search
48+
? `https://${domain}/api?query=${options.keyword}`
49+
: `https://${domain}/docs?search=${options.keyword}`,
50+
);
5551
}
5652
}

0 commit comments

Comments
 (0)