Skip to content

Commit 8fa1cd4

Browse files
committed
Minor fixes
1 parent 311b7e8 commit 8fa1cd4

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

commands/basec/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = (args, api) => {
66
const { RED } = require("../../utils/colors");
77
const componentName = args._[0];
88
const scaffoldButton = args["scaffold-button"];
9-
const prefix = args.preffix ? capitalize(args.preffix) : "Base";
9+
const prefix = args.prefix ? capitalize(args.prefix) : "Base";
1010

1111
if (componentName || scaffoldButton) {
1212
const filename = componentName ? `${prefix + capitalize(componentName)}` : "BaseButton";
@@ -16,8 +16,7 @@ module.exports = (args, api) => {
1616
directory = `src/components/base/${filename}-${Math.random().toString(36).slice(-5)}.vue`;
1717
dirPath = api.resolve(directory);
1818
}
19-
const strMatch = scaffoldButton ? /name: "BaseButton",/ : /name: "base",/;
20-
const content = replaceContent(`${__dirname}/templates/Base${scaffoldButton ? "Button" : ""}.vue`, strMatch, ` name: "${filename}",`);
19+
const content = replaceContent(`${__dirname}/templates/Base${scaffoldButton ? "Button" : ""}.vue`, /name: "base",/, ` name: "${filename}",`);
2120
fs.writeFileSync(dirPath, content.join(EOL), { encoding: "utf-8" });
2221
console.log(`\n${filename} created succesfully`);
2322
} else {

commands/basec/templates/BaseButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<script>
1010
export default {
11-
name: "BaseButton",
11+
name: "base",
1212
inheritAttrs: false,
1313
};
1414
</script>

ui.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ module.exports = (api) => {
55
link: "https://github.com/DevTony101/vue-cli-plugin-clean#using-the-basec-command",
66
prompts: [
77
{
8-
name: "preffix",
8+
name: "prefix",
99
type: "input",
1010
default: "Base",
11-
description: "The preffix for the name of the component (it defaults to 'Base')",
11+
description: "The prefix for the name of the component (it defaults to 'Base')",
1212
},
1313
{
1414
name: "name",
@@ -35,7 +35,7 @@ module.exports = (api) => {
3535
],
3636
onBeforeRun: async ({ answers, args }) => {
3737
if (answers.name && answers.name.trim()) args.push(answers.name);
38-
if (answers.preffix && answers.preffix.trim()) args.push("--preffix", answers.preffix);
38+
if (answers.prefix && answers.prefix.trim()) args.push("--prefix", answers.prefix);
3939
switch (answers.scaffold) {
4040
case "button":
4141
args.push("--scaffold-button");

0 commit comments

Comments
 (0)