Skip to content

Commit

Permalink
fix: path resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenYCL committed Dec 2, 2020
1 parent 29b60de commit 5c1d9ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,7 @@ export async function createProject(options) {
name: 'ChenYCL',
};

const fullPathName = new URL(import.meta.url).pathname;
const templateDir = path.resolve(
fullPathName.substr(fullPathName.indexOf('/')),
'../../templates',
options.template.toLowerCase()
);
const templateDir = path.join(__dirname,'..','templates', options.template.toLowerCase())
options.templateDirectory = templateDir;

try {
Expand Down
2 changes: 1 addition & 1 deletion templates/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"@umijs/plugin-esbuild": "^1.0.0-beta.2",
"@umijs/plugin-qiankun": "^2.17.5",
"@umijs/preset-ant-design-pro": "^1.2.0",
"@umijs/preset-react": "^1.4.8",
"@umijs/preset-react": "1.7.0",
"@umijs/yorkie": "^2.0.3",
"carlo": "^0.9.46",
"cross-env": "^7.0.0",
Expand Down

0 comments on commit 5c1d9ab

Please sign in to comment.