Skip to content

Commit

Permalink
fix(file-generator): path变量冲突
Browse files Browse the repository at this point in the history
  • Loading branch information
StreakingMan committed Mar 2, 2022
1 parent 164c6ae commit 8db92e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/file-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const generatorTemplateFileMap = {
reactCompInterface: 'interface.ts',
};

const fileGenerator = ({ templateName, path = '/', option = {} }) => {
const fileGenerator = ({ templateName, pathName = '/', option = {} }) => {
const { react, ts, compName, CompName } = option;
const cwd = process.cwd();
const file = path.join(
Expand All @@ -37,7 +37,7 @@ const fileGenerator = ({ templateName, path = '/', option = {} }) => {
const filename = generatorTemplateFileMap[templateName];

fse.outputFileSync(
path.join(path.join(cwd, path), filename),
path.join(path.join(cwd, pathName), filename),
ejs.render(template, data)
);

Expand Down

0 comments on commit 8db92e5

Please sign in to comment.