Skip to content

Commit

Permalink
chore(scripts): 🔧 add readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
gracefullight committed May 7, 2024
1 parent a9e4d23 commit 8465466
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions scripts/commands/NewPluginCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { Transform } from "stream";

import { Command, Option, UsageError } from "clipanion";
import {
pathExists,
readdir,
createWriteStream,
createReadStream,
createWriteStream,
ensureDir,
pathExists,
readdir,
} from "fs-extra";
import {
camelCase,
Expand All @@ -26,8 +26,8 @@ interface ReplaceOptions {
}

export class NewPluginCommand extends Command {
static paths = [[`new`]];
static usage = Command.Usage({
static readonly paths = [[`new`]];
static readonly usage = Command.Usage({
description: "create a new docusaurus plugin",
details:
"This command will create a new docusaurus plugin in the packages directory with the specified name. The plugin will include a basic template with options for customization.",
Expand Down Expand Up @@ -68,7 +68,7 @@ export class NewPluginCommand extends Command {
this.push(template(file.toString())(variables));
callback();
},
})
}),
)
.pipe(createWriteStream(join(to, pluginFileName)))
.on("error", (error) => {
Expand All @@ -88,7 +88,7 @@ export class NewPluginCommand extends Command {
const pluginDirectory = join(
pluginRoot,
"packages",
`docusaurus-plugin-${pluginName}`
`docusaurus-plugin-${pluginName}`,
);

if (await pathExists(pluginDirectory)) {
Expand Down

0 comments on commit 8465466

Please sign in to comment.