Skip to content

Commit

Permalink
fix(pv-stylemark): fixed windows path issue
Browse files Browse the repository at this point in the history
fixed windows path issue, with md-globs
  • Loading branch information
friewerts committed Feb 21, 2024
1 parent 30f29ab commit f03a00a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/pv-stylemark/helper/io-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ const writeFile = async (target, reldir, filename, markup) => {
};

const watchGlob = async (curGlob, callback) => {
const paths = await glob(curGlob);
const paths = await glob(curGlob, {
windowsPathsNoEscape: true,
});
const normalizedPaths = paths.map(filePath => normalize(resolve(process.cwd(), filePath)));
normalizedPaths.forEach(path => {
watchFile(path, () => callback());
Expand Down
4 changes: 3 additions & 1 deletion packages/pv-stylemark/tasks/lsg/getLsgData.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ const getDataSortedByCategory = (lsgData, config) => {

const getLsgData = async (curGlob, config) => {
const { componentsSrc } = getAppConfig();
const paths = await glob(curGlob);
const paths = await glob(curGlob, {
windowsPathsNoEscape: true,
});
const normalizedPaths = paths.map(filePath => normalize(resolve(process.cwd(), filePath)));

const data = await Promise.all(normalizedPaths.map(curPath => getLsgDataForPath(curPath, componentsSrc)));
Expand Down

0 comments on commit f03a00a

Please sign in to comment.