Skip to content

Commit

Permalink
Add Windows back.
Browse files Browse the repository at this point in the history
  • Loading branch information
hildjj committed Oct 10, 2022
1 parent 689ae09 commit b381ec1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ jobs:
strategy:
matrix:
node-version: [12.x, 14.x, 16.x, 18.x]
os: [ubuntu-latest, macos-latest]
# Add windows-latest back after updating tests
os: [ubuntu-latest, macos-latest, windows-latest]

runs-on: ${{ matrix.os }}

Expand All @@ -39,6 +38,7 @@ jobs:
with:
github-token: ${{ secrets.github_token }}
flag-name: node-${{ matrix.node-version }}
path-to-lcov: ./coverage/lcov.info
parallel: true
finish:
needs: build
Expand All @@ -48,4 +48,5 @@ jobs:
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: ./coverage/lcov.info
parallel-finished: true
14 changes: 9 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { parse_to_uint32array, TokenTypes } from '@one-ini/wasm'
// package.json
import pkg from '../package.json'

const escapedSep = new RegExp(path.sep.replace(/\\/g, '\\\\'), 'g')

// These are specified by the editorconfig script
/* eslint-disable @typescript-eslint/naming-convention */
export interface KnownProps {
Expand Down Expand Up @@ -166,7 +168,8 @@ function buildFullGlob(pathPrefix: string, glob: string): string {
default:
break
}
return path.join(pathPrefix, glob)
// NOT path.join. Must stay in forward slashes.
return `${pathPrefix}/${glob}`
}

function extendProps(props: Props, options: Props): Props {
Expand Down Expand Up @@ -203,10 +206,11 @@ function parseFromConfigs(
.reverse()
.reduce(
(matches: Props, file) => {
const pathPrefix = path.dirname(file.name)
file.contents.forEach((section) => {
const glob = section[0]
const options2 = section[1]
let pathPrefix = path.dirname(file.name)
if (path.sep !== '/') {
pathPrefix = pathPrefix.replace(escapedSep, '/')
}
file.contents.forEach(([glob, options2]) => {
if (!glob) {
return
}
Expand Down

0 comments on commit b381ec1

Please sign in to comment.