|
1 | 1 | import { type AbsoluteFilePath, cwd, doesPathExist, resolve } from "@fern-api/fs-utils"; |
2 | 2 | import fs from "fs"; |
3 | | -import { mkdir, readFile, writeFile } from "fs/promises"; |
| 3 | +import { mkdir, readFile } from "fs/promises"; |
4 | 4 | import path from "path"; |
5 | 5 | import { hideBin } from "yargs/helpers"; |
6 | 6 | import yargs from "yargs/yargs"; |
7 | 7 |
|
8 | 8 | import { generateReadmeToStream, generateReferenceToStream, githubPr, githubPush } from "./api"; |
9 | 9 | import { githubRelease } from "./api/github-release"; |
10 | 10 | import { loadGitHubConfig } from "./configuration/loadGitHubConfig"; |
11 | | -import { loadMetadataConfig } from "./configuration/loadMetadataConfig"; |
12 | 11 | import { loadReadmeConfig } from "./configuration/loadReadmeConfig"; |
13 | 12 | import { loadReferenceConfig } from "./configuration/loadReferenceConfig"; |
14 | 13 |
|
@@ -81,35 +80,6 @@ void yargs(hideBin(process.argv)) |
81 | 80 | process.exit(0); |
82 | 81 | } |
83 | 82 | ) |
84 | | - .command( |
85 | | - "write-metadata", |
86 | | - "Write metadata to the output directory using the provided configuration file.", |
87 | | - (argv) => |
88 | | - argv |
89 | | - .option("config", { |
90 | | - string: true, |
91 | | - required: true |
92 | | - }) |
93 | | - .option("output", { |
94 | | - string: true, |
95 | | - required: false |
96 | | - }), |
97 | | - async (argv) => { |
98 | | - if (argv.config == null) { |
99 | | - process.stderr.write("missing required arguments; please specify the --config flag\n"); |
100 | | - process.exit(1); |
101 | | - } |
102 | | - const wd = cwd(); |
103 | | - const metadata = await loadMetadataConfig({ |
104 | | - absolutePathToConfig: resolve(wd, argv.config) |
105 | | - }); |
106 | | - const outputPath = argv.output != null ? resolve(wd, argv.output) : resolve(wd, ".fern/metadata.json"); |
107 | | - const formattedMetadata = JSON.stringify(metadata, null, 2); |
108 | | - await mkdir(path.dirname(outputPath), { recursive: true }); |
109 | | - await writeFile(outputPath, formattedMetadata, "utf8"); |
110 | | - process.exit(0); |
111 | | - } |
112 | | - ) |
113 | 83 | .command("github", "GitHub operations", (yargs) => { |
114 | 84 | return yargs |
115 | 85 | .command( |
|
0 commit comments