Skip to content

Commit

Permalink
fix: Fix windows glob filepaths problem due to upgrading to latest gl…
Browse files Browse the repository at this point in the history
…obby.

Standardized the slashes to forward.
  • Loading branch information
dsherret committed Jul 16, 2019
1 parent fd6534c commit e9665a0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -90,7 +90,7 @@
"@types/is-negated-glob": "^1.0.0",
"@types/mocha": "^5.2.7",
"@types/multimatch": "^2.1.3",
"@types/node": "^12.6.2",
"@types/node": "^12.6.3",
"@types/ts-nameof": "^3.2.0",
"chai": "^4.2.0",
"chalk": "^2.4.2",
Expand Down
2 changes: 2 additions & 0 deletions src/fileSystem/DefaultFileSystemHost.ts
Expand Up @@ -153,6 +153,8 @@ export class DefaultFileSystemHost implements FileSystemHost {
}

glob(patterns: ReadonlyArray<string>) {
// convert backslashes to foward
patterns = patterns.map(p => p.replace(/\\/g, "/")); // maybe this isn't full-proof?
return this.globby.sync(patterns, {
cwd: this.getCurrentDirectory(),
absolute: true
Expand Down
2 changes: 1 addition & 1 deletion src/tests/projectTests.ts
Expand Up @@ -836,7 +836,7 @@ describe(nameof(Project), () => {

describe("mixing real files with virtual files", () => {
function createProject() {
const testFilesDirPath = path.join(__dirname, "../../src/tests/testFiles").replace(/\\/g, "/");
const testFilesDirPath = path.join(__dirname, "../../src/tests/testFiles");
const project = new Project();
project.addExistingSourceFiles(`${testFilesDirPath}/**/*.ts`);
project.createSourceFile(
Expand Down
6 changes: 5 additions & 1 deletion yarn.lock
Expand Up @@ -159,10 +159,14 @@
dependencies:
"@types/minimatch" "*"

"@types/node@*", "@types/node@^12.6.2":
"@types/node@*":
version "12.6.2"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.6.2.tgz#a5ccec6abb6060d5f20d256fb03ed743e9774999"

"@types/node@^12.6.3":
version "12.6.3"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.6.3.tgz#44d507c5634f85e7164707ca36bba21b5213d487"

"@types/ts-nameof@^3.2.0":
version "3.2.0"
resolved "https://registry.yarnpkg.com/@types/ts-nameof/-/ts-nameof-3.2.0.tgz#77c68c06471d3fab031ca1a2113fe1ffbe95c86f"
Expand Down

0 comments on commit e9665a0

Please sign in to comment.