Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
*/

import getHeaderSearchPath from '../getHeaderSearchPath';

const path = require('path');
import {posix as path} from 'path';

const SRC_DIR = path.join('react-native-project', 'ios');

Expand Down
8 changes: 4 additions & 4 deletions packages/platform-ios/src/link/getHeaderSearchPath.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @format
*/

import path from 'path';
import {posix as path} from 'path';
import {last, union} from 'lodash';

/**
Expand All @@ -22,14 +22,14 @@ import {last, union} from 'lodash';
*/
const getOuterDirectory = directories =>
directories.reduce((topDir, currentDir) => {
const currentFolders = currentDir.split('/');
const topMostFolders = topDir.split('/');
const currentFolders = currentDir.split(path.sep);
const topMostFolders = topDir.split(path.sep);

if (
currentFolders.length === topMostFolders.length &&
last(currentFolders) !== last(topMostFolders)
) {
return currentFolders.slice(0, -1).join('/');
return currentFolders.slice(0, -1).join(path.sep);
}

return currentFolders.length < topMostFolders.length ? currentDir : topDir;
Expand Down