|
1 | 1 | import { execFileSync } from "node:child_process"; |
2 | | -import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; |
| 2 | +import { |
| 3 | + existsSync, |
| 4 | + mkdirSync, |
| 5 | + mkdtempSync, |
| 6 | + readFileSync, |
| 7 | + rmSync, |
| 8 | + writeFileSync |
| 9 | +} from "node:fs"; |
3 | 10 | import { tmpdir } from "node:os"; |
4 | 11 | import { dirname, join } from "node:path"; |
5 | 12 | import { fileURLToPath } from "node:url"; |
@@ -34,15 +41,11 @@ try { |
34 | 41 | } |
35 | 42 |
|
36 | 43 | const consumer = join(workspace, "consumer"); |
| 44 | + mkdirSync(consumer, { recursive: true }); |
37 | 45 | writeFileSync( |
38 | | - join(workspace, "consumer-package.json"), |
39 | | - JSON.stringify({ name: "beforecode-package-verification", private: true }, null, 2) |
| 46 | + join(consumer, "package.json"), |
| 47 | + `${JSON.stringify({ name: "beforecode-package-verification", private: true }, null, 2)}\n` |
40 | 48 | ); |
41 | | - execFileSync(process.execPath, ["-e", ` |
42 | | - const fs = require("node:fs"); |
43 | | - fs.mkdirSync(${JSON.stringify(consumer)}, { recursive: true }); |
44 | | - fs.copyFileSync(${JSON.stringify(join(workspace, "consumer-package.json"))}, ${JSON.stringify(join(consumer, "package.json"))}); |
45 | | - `]); |
46 | 49 |
|
47 | 50 | const tarball = join(workspace, packResult.filename); |
48 | 51 | execFileSync( |
|
0 commit comments