Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f656853

Browse files
committedApr 27, 2021
Fix schema globbing on Windows
1 parent 01ed70c commit f656853

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎src/getAppSyncConfig.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ export default function getAppSyncConfig(context, appSyncConfig) {
3636
});
3737
};
3838

39-
const toAbsolutePath = (basePath, filePath) =>
40-
path.isAbsolute(filePath) ? filePath : path.join(basePath, filePath);
39+
const toAbsolutePosixPath = (basePath, filePath) =>
40+
(path.isAbsolute(filePath) ? filePath : path.join(basePath, filePath)).replace(/\\/g, '/');
4141

4242
const globFilePaths = (basePath, filePaths) => {
4343
return filePaths
4444
.map((filePath) => {
45-
const paths = globby.sync(toAbsolutePath(basePath, filePath));
45+
const paths = globby.sync(toAbsolutePosixPath(basePath, filePath));
4646
if (path.isAbsolute(filePath)) {
4747
return paths;
4848
} else {
@@ -55,7 +55,7 @@ export default function getAppSyncConfig(context, appSyncConfig) {
5555

5656
const getFileMap = (basePath, filePath) => ({
5757
path: filePath,
58-
content: fs.readFileSync(toAbsolutePath(basePath, filePath), {
58+
content: fs.readFileSync(toAbsolutePosixPath(basePath, filePath), {
5959
encoding: 'utf8',
6060
}),
6161
});

0 commit comments

Comments
 (0)
Please sign in to comment.