Skip to content

Commit

Permalink
fix: no lang suffix file copy error
Browse files Browse the repository at this point in the history
  • Loading branch information
zuofenghua committed Jan 29, 2021
1 parent 530d9f3 commit e7a4979
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vitepress-for-component",
"version": "0.11.9",
"version": "0.11.10",
"description": "dumi like documentation tool",
"main": "dist/node/index.js",
"typings": "types/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/node/temporary/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function tolocalePath(mapping: Record<string, string> | null, path: string) {
// en/
const langPrefix = mapping[lang.slice(1)]

if (!lang) {
if (!(lang.slice(1) in mapping)) {
return path
}
return `${langPrefix}${path.slice(0, -(ext + lang).length)}${ext}`
Expand Down

0 comments on commit e7a4979

Please sign in to comment.