Skip to content

Commit 134da5c

Browse files
committed
fix CLI on Windows
1 parent 415f478 commit 134da5c

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

cli/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { spawnSync } from "child_process";
99

1010
const nodeModulesDir = path.dirname(path.dirname(path.dirname(__dirname)));
1111
const hiddenDir = path.join(nodeModulesDir, ".ngrpc");
12-
const cmdPath = path.join(hiddenDir, "ngrpc");
12+
const cmdPath = path.join(hiddenDir, process.platform === "win32" ? "ngrpc.exe" : "ngrpc");
1313
let zipName: string | undefined;
1414

1515
if (process.platform === "darwin") {

cli/ngrpc/cmd/init.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,14 @@ var initCmd = &cobra.Command{
378378

379379
depCmd = exec.Command("go", "mod", "tidy")
380380
} else if template == "node" {
381-
depCmd = exec.Command("npm", "i", "-D", "typescript", "tslib", "source-map-support")
381+
depCmd = exec.Command(
382+
"npm",
383+
"i",
384+
"-D",
385+
"@types/node",
386+
"typescript",
387+
"tslib",
388+
"source-map-support")
382389
}
383390

384391
if depCmd != nil {

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
22
"name": "@ayonli/ngrpc",
3-
"version": "0.2.2",
3+
"version": "0.2.3",
44
"description": "Make it easy to create clean and elegant gRPC based microservices.",
55
"main": "dist/index.js",
66
"types": "index.ts",
7-
"bin": "dist/cli/index.js",
7+
"bin": {
8+
"ngrpc": "dist/cli/index.js"
9+
},
810
"scripts": {
911
"prepublishOnly": "tsc",
1012
"test": "mocha"

0 commit comments

Comments
 (0)