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

Support Windows #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,16 @@ module.exports = {
const omit = (this._options.omit ?? []).map((o) => toMatcher(o));
const include = (this._options.include ?? []).map((o) => toMatcher(o));
const types = (this._options.types ?? []).map((o) => toMatcher(o));
const icons = globSync(path.join(heroIconsPath, '**', '*.svg'))
// glob always expects path separators to be forward slashes, even on systems where the separator
// is a back slash. So we let path.join do what it does, and then we change instances of \ to /.
const safeGlobPath = path.join(heroIconsPath, '**', '*.svg').replace(/\\/g, '/');
const icons = globSync(safeGlobPath)
.map((f) =>
f
.replace(heroIconsPath, '')
// Oddly enough glob return paths with the system separator. So in order to be able
// to split on '/' we have to once again change instances of \ to /
.replace(/\\/g, '/')
.split('/')
.filter((f) => f)
)
Expand Down
1 change: 1 addition & 0 deletions tests/integration/components/hero-icon-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ module('Integration | Component | hero-icon', function (hooks) {
test('it renders', async function (assert) {
await render(hbs`<HeroIcon @icon="film"/>`);
assert.dom('svg').exists();
assert.dom('path').exists();
});
});