Skip to content

Commit

Permalink
Try testing on windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
frankdejonge committed Jan 1, 2025
1 parent 6538031 commit 787d04d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
platform: [ubuntu-latest]
platform: [ubuntu-latest, windows-latest, macos-latest]
node: [20, 21, 22]
experimental: [false]
include:
Expand All @@ -30,14 +30,14 @@ jobs:
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Paths Changes Filter
id: changes
uses: dorny/paths-filter@v3.0.2
with:
list-files: shell
filters: |
source:
- 'packages/**/*.(ts|tsx|js|jsx)'
# - name: Paths Changes Filter
# id: changes
# uses: dorny/paths-filter@v3.0.2
# with:
# list-files: shell
# filters: |
# source:
# - 'packages/**/*.(ts|tsx|js|jsx)'
- name: Install Node.js
uses: actions/setup-node@v4
with:
Expand Down
8 changes: 6 additions & 2 deletions packages/file-storage/src/path-prefixer.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import {join} from 'node:path';

export type PathJoiner = (...paths: string[]) => string;

export class PathPrefixer {
private readonly prefix: string = '';
constructor(
prefix: string = '',
private readonly separator: string = '/',
private readonly joinFunc: typeof join = join,
private readonly joinFunc: PathJoiner = join,
) {
if (prefix.length > 0) {
this.prefix = this.joinFunc(prefix, this.separator);
Expand All @@ -17,7 +19,9 @@ export class PathPrefixer {
}

prefixDirectoryPath(path: string): string {
return this.prefix.length > 0 ? this.joinFunc(this.prefix, path, '/') : this.joinFunc(path, '/');
return this.prefix.length > 0
? this.joinFunc(this.prefix, path, this.separator)
: this.joinFunc(path, this.separator);
}

stripFilePath(path: string): string {
Expand Down

0 comments on commit 787d04d

Please sign in to comment.