Skip to content

Commit 2db9102

Browse files
committed
Update packageReadme.ts
1 parent ade7311 commit 2db9102

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/packageReadme.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { execSync } from "child_process";
2-
import { existsSync, readdirSync, readFileSync, writeFileSync } from "fs";
2+
import { existsSync, mkdir, mkdirSync, readdirSync, readFileSync, writeFileSync } from "fs";
33
import path from "path";
44
import { parseHeader } from "./header-parser";
55
import { readmeFilenames, scripts, scriptsPath } from "./utils";
@@ -38,7 +38,8 @@ function isValidHttpUrl(string: string) {
3838

3939
function makeReadme (script: string) {
4040
const indexJs = path.resolve(scriptsPath, script, 'index.js');
41-
const readmePath = path.resolve(process.cwd(), 'temp', script, 'README.md');
41+
const tempDir = path.resolve(process.cwd(), 'node_modules/.cache');
42+
const readmePath = path.resolve(tempDir, script, 'README.md');
4243
const readmeDefault = [
4344
'# ' + script,
4445
'',
@@ -50,6 +51,7 @@ function makeReadme (script: string) {
5051
''
5152
];
5253

54+
mkdir(path.resolve(tempDir, script), console.warn);
5355
if (!existsSync(indexJs)) {
5456
console.error(script, "missing index.js");
5557
writeFileSync(readmePath, readmeDefault.join('\n'));

0 commit comments

Comments
 (0)