Skip to content

Commit ab47c1a

Browse files
authored
chore: Builds now work with Windows Subsystem for Linux (WSL). (#17513)
Small changes to make builds work in Windows Subsystem for Linux (WSL). Verified by **partial** building in Windows 10 + Ubuntu 18.04 WSL. fixes #55 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent d115b47 commit ab47c1a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tools/@aws-cdk/eslint-plugin/lib/rules/invalid-cfn-imports.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function checkIfImportedLocationIsAnAlphaPackage(location: string, currentFilena
127127
}
128128

129129
function getCdkRootDir(filename: string): string | undefined {
130-
const filenameSplit = filename.split('/');
130+
const filenameSplit = filename.split(path.sep);
131131
// for test files
132132
let rootDirIndex = filenameSplit.findIndex(e => e.match('tools'));
133133

tools/@aws-cdk/pkglint/lib/rules.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ export class RepositoryCorrect extends ValidationRule {
130130
expectJSON(this.name, pkg, 'repository.type', 'git');
131131
expectJSON(this.name, pkg, 'repository.url', 'https://github.com/aws/aws-cdk.git');
132132
const pkgDir = path.relative(monoRepoRoot(), pkg.packageRoot);
133-
expectJSON(this.name, pkg, 'repository.directory', pkgDir);
133+
// Enforcing '/' separator for builds to work in Windows.
134+
const osPkgDir = pkgDir.split(path.sep).join('/');
135+
expectJSON(this.name, pkg, 'repository.directory', osPkgDir);
134136
}
135137
}
136138

0 commit comments

Comments
 (0)