Skip to content

Commit 564f570

Browse files
committed
fix(ios): don't nest absolute NativeSource glob matches under the project
fast-glob returns absolute matches for an absolute pattern, and joining them onto the project folder produced paths like /proj/proj/src/File.swift. Resolving them against the project keeps absolute matches as they are.
1 parent 43270f0 commit 564f570

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

‎lib/services/ios-project-service.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,8 +1630,7 @@ export class IOSProjectService
16301630
// Relative to the project: --path can run the CLI from anywhere.
16311631
const filePaths = await fastGlob(rootPath, { cwd: projectRoot });
16321632
for (const filePath of filePaths) {
1633-
const sourceFilePath = path.normalize(path.join(projectRoot, filePath));
1634-
filePathsArr.push(sourceFilePath);
1633+
filePathsArr.push(path.resolve(projectRoot, filePath));
16351634
}
16361635
} else {
16371636
const folderPath = path.resolve(projectRoot, rootPath);

‎test/ios-project-service-native-source.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ describe("iOSProjectService getRootGroup", () => {
4747
]);
4848
});
4949

50+
it("keeps an absolute glob as it is", async () => {
51+
assert.deepEqual(await getFiles(path.join(sourcesDir, "*.swift")), [
52+
expectedSource(),
53+
]);
54+
});
55+
5056
it("resolves a folder against the project, not the working directory", async () => {
5157
assert.deepEqual(await getFiles("../../libs/native"), [expectedSource()]);
5258
});

0 commit comments

Comments
 (0)