Skip to content

Commit d6e431e

Browse files
authored
fix(typings): spawn to work with Windows as well
1 parent 52b51e7 commit d6e431e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/commands/typings.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { IOptions } from "../declarations";
2-
import { IChildProcess, IFileSystem } from "../common/declarations";
2+
import { IChildProcess, IFileSystem, IHostInfo } from "../common/declarations";
33
import { ICommand, ICommandParameter } from "../common/definitions/commands";
44
import { injector } from "../common/yok";
55
import { IProjectData } from "../definitions/project";
@@ -13,7 +13,8 @@ export class TypingsCommand implements ICommand {
1313
private $fs: IFileSystem,
1414
private $projectData: IProjectData,
1515
private $mobileHelper: Mobile.IMobileHelper,
16-
private $childProcess: IChildProcess
16+
private $childProcess: IChildProcess,
17+
private $hostInfo: IHostInfo,
1718
) {}
1819

1920
public async execute(args: string[]): Promise<void> {
@@ -74,7 +75,7 @@ ns typings android --jar classes.jar --jar dependency-of-classes-jar.jar
7475
if (!this.$fs.exists(dtsGeneratorPath)) {
7576
this.$logger.warn("No platforms folder found, preparing project now...");
7677
await this.$childProcess.spawnFromEvent(
77-
"ns",
78+
this.$hostInfo.isWindows ? "ns.cmd" : "ns",
7879
["prepare", "android"],
7980
"exit",
8081
{ stdio: "inherit" }

0 commit comments

Comments
 (0)