|
1 | 1 | import { CommandModule } from "yargs"; |
2 | | -import * as fs from "fs"; |
3 | | -import { logger } from "../utils/log"; |
4 | | -import { directoryExists } from "../utils/fs"; |
5 | | -import { Installation, readInstallInfo } from "../utils/installation"; |
6 | | -import { corePackages } from "../nodecgIOVersions"; |
7 | | -import { GenerationOptions, promptGenerationOpts } from "./prompt"; |
8 | | -import { runNpmBuild, runNpmInstall } from "../utils/npm"; |
9 | | -import { genExtension } from "./extension"; |
10 | | -import { findNodeCGDirectory, getNodeCGIODirectory } from "../utils/nodecgInstallation"; |
11 | | -import { genDashboard, genGraphic } from "./panel"; |
12 | | -import { genTsConfig } from "./tsConfig"; |
13 | | -import { writeBundleFile, yellowInstallCommand } from "./utils"; |
14 | | -import { genPackageJson } from "./packageJson"; |
| 2 | +import { promises as fs } from "fs"; |
| 3 | +import { logger } from "../utils/log.js"; |
| 4 | +import { directoryExists } from "../utils/fs.js"; |
| 5 | +import { Installation, readInstallInfo } from "../utils/installation.js"; |
| 6 | +import { corePackages } from "../nodecgIOVersions.js"; |
| 7 | +import { GenerationOptions, promptGenerationOpts } from "./prompt.js"; |
| 8 | +import { runNpmBuild, runNpmInstall } from "../utils/npm.js"; |
| 9 | +import { genExtension } from "./extension.js"; |
| 10 | +import { findNodeCGDirectory, getNodeCGIODirectory } from "../utils/nodecgInstallation.js"; |
| 11 | +import { genDashboard, genGraphic } from "./panel.js"; |
| 12 | +import { genTsConfig } from "./tsConfig.js"; |
| 13 | +import { writeBundleFile, yellowInstallCommand } from "./utils.js"; |
| 14 | +import { genPackageJson } from "./packageJson.js"; |
15 | 15 |
|
16 | 16 | export const generateModule: CommandModule = { |
17 | 17 | command: "generate", |
@@ -64,11 +64,11 @@ export function ensureValidInstallation(install: Installation | undefined): inst |
64 | 64 | export async function generateBundle(opts: GenerationOptions, install: Installation): Promise<void> { |
65 | 65 | // Create dir if necessary |
66 | 66 | if (!(await directoryExists(opts.bundlePath))) { |
67 | | - await fs.promises.mkdir(opts.bundlePath); |
| 67 | + await fs.mkdir(opts.bundlePath); |
68 | 68 | } |
69 | 69 |
|
70 | 70 | // In case some re-executes the command in a already used bundle name we should not overwrite their stuff and error instead. |
71 | | - const filesInBundleDir = await fs.promises.readdir(opts.bundlePath); |
| 71 | + const filesInBundleDir = await fs.readdir(opts.bundlePath); |
72 | 72 | if (filesInBundleDir.length > 0) { |
73 | 73 | throw new Error( |
74 | 74 | `Directory for bundle at ${opts.bundlePath} already exists and contains files.\n` + |
|
0 commit comments