pbxProject hasFile returns false for existing file on Windows
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- mobile-dev
Research direction
Start with the project.hasFile call against the referenced project.pbxproj and reproduce it using the linked cross-platform example on Windows, Linux, and macOS. Trace how the Windows-formatted SPLASH_SCREEN_PATH is checked, and consider the issue done when an existing file is detected on Windows without breaking the other platforms.
Written by the indexing model from the issue text.
Description
We are running into an issue with this in our Expo CLI on Windows. After some investigation, it looks like there are some issues with Posix and Windows paths when detecting if files exists or not.
I created a repository with an example running on Ubuntu, MacOS and Windows that demonstrates this issue. The scenario it's testing is fairly simple:
const PBX_PROJECT_PATH = path.resolve('ios', 'testios2.xcodeproj', 'project.pbxproj');
const SPLASH_SCREEN_PATH = path.join('testios2', 'SplashScreen.storyboard');
// Create a new pbx project instance
const project = xcode.project(PBX_PROJECT_PATH);
// Now parse the project
project.parseSync();
// Determine if "SplashScreen.storyboard" exists
const file = project.hasFile(SPLASH_SCREEN_PATH);
You see that this is done successfully on both Linux and MacOS, but fails on Windows.
There is a workaround, you have to force the SPLASH_SCREEN_PATH to always be a posix formatted path. That works on Linux, MacOS, and Windows.
const SPLASH_SCREEN_PATH = path.join('testios2', 'SplashScreen.storyboard')
// Force the path to always be a posix formatted path
.replace(path.sep, path.posix.sep);
- Dominant language
- JavaScript
- Stars
- 217
- Forks
- 102
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 8
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/cordova-node-xcode
-
Add & Improve JSDocs Openenhancement
apache/cordova-node-xcode#171 · 1 assignee ·
-
🔖 New release Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
apache/cordova-node-xcode#162 · 4 comments · 2 reactions ·
-
Install .xcframework Open
Difficulty 3/5 1-2 days Newbie friendliness 28/100
apache/cordova-node-xcode#139 · 2 comments ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
apache/cordova-node-xcode#138 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
apache/cordova-node-xcode#137 · 2 reactions ·
All issues in apache/cordova-node-xcode
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
palladius/rails8-app-on-gcp#145 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
dotenvx/dotenv-vscode#139 ·
-
test-change-proposal
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
web-platform-tests/interop#1455 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
corsairdev/corsair#1764 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100