Skip to content

Commit

Permalink
fix: correct file paths of document which will be updated
Browse files Browse the repository at this point in the history
  • Loading branch information
orzyyyy committed Sep 23, 2019
1 parent 366c989 commit d61c907
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
24 changes: 8 additions & 16 deletions nino.koei.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,14 @@ const getCopyPluginProps = mappings => {
const src = `src/assets/${category}/${id}.${ext}`;
const dist = `dist/${category}/${id}/${id}.${ext}`;
const distEditor = `dist/${category}-editor/${id}/${id}.${ext}`;
if (category === 'mapping') {
documentFiles.push({
from: path.join(__dirname, src),
to: path.join(__dirname, dist),
});
}
if (category === 'markdown') {
documentFiles.push({
from: path.join(__dirname, src),
to: path.join(__dirname, dist),
});
documentFiles.push({
from: path.join(__dirname, src),
to: path.join(__dirname, distEditor),
});
}
documentFiles.push({
from: path.join(__dirname, src),
to: path.join(__dirname, dist),
});
documentFiles.push({
from: path.join(__dirname, src),
to: path.join(__dirname, distEditor),
});
});

return [...assetsFiles, ...exhentaiFiles, ...documentFiles];
Expand Down
6 changes: 4 additions & 2 deletions server/utils/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ const getWriteMappingPaths = (
return [`src/assets/mapping.json`, `dist/assets/mapping.json`];
}
checkCategory(category);
const ext = category === 'mapping' ? 'json' : 'md';
return [
`src/assets/${category}/${id}.${category === 'mapping' ? 'json' : 'md'}`,
`dist/assets/${category}/${id}.${category === 'mapping' ? 'json' : 'md'}`,
`src/assets/${category}/${id}.${ext}`,
`dist/${category}/${id}/${id}.${ext}`,
`dist/${category}-editor/${id}/${id}.${ext}`,
];
};

Expand Down

0 comments on commit d61c907

Please sign in to comment.