Skip to content

Commit 461808e

Browse files
authored
support windows (#8)
1 parent 9964800 commit 461808e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cli.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const path = require('path');
44
const fs = require('fs');
5+
const os = require("os");
56
const ts = require('typescript');
67

78
const getArg = (argName) => {
@@ -82,7 +83,9 @@ try {
8283
fs.writeFileSync(outFile, typing);
8384

8485
// if we are writing to the node_modules/@types directory, add a package.json file
85-
if (outputDir.includes('node_modules/@types')) {
86+
if (outputDir.includes( os.platform() === "win32"
87+
? "node_modules\\@types"
88+
: "node_modules/@types")) {
8689
const packageJsonPath = path.resolve(outputDir, 'package.json');
8790

8891
if (!fs.existsSync(packageJsonPath)) {

0 commit comments

Comments
 (0)