Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme Check: Issue of 0 files being inspected on Windows when using the CLI #322

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/theme-check-node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,15 @@ async function getThemeAndConfig(
}

export async function getTheme(config: Config): Promise<Theme> {
const paths = await asyncGlob(path.join(config.root, '**/*.{liquid,json}')).then((result) =>

// On windows machines - the separator provided by path.join is '\'
// however the glob function fails silently since '\' is used to escape glob charater
// as mentioned in the documentation of node-glob

// the path is normalised and '\' are replaced with '/' and then passed to the glob function
const normalized_path = path.normalize(path.join(config.root, '**/*.{liquid,json}')).replace(/\\/g, '/');

const paths = await asyncGlob(normalized_path).then((result) =>
// Global ignored paths should not be part of the theme
result.filter((filePath) => !isIgnored(filePath, config)),
);
Expand Down
Loading