Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

pbxProject hasFile returns false for existing file on Windows

オープン
#116 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript
領域
mobile-dev

調査の方向性

参照されている project.pbxproj に対する project.hasFile の呼び出しから始め、リンクされているクロスプラットフォームの例を使って Windows、Linux、macOS で再現します。Windows 形式の SPLASH_SCREEN_PATH がどのようにチェックされるかを追跡し、他のプラットフォームを壊すことなく Windows で既存のファイルが検出された時点で issue 完了とします。

索引モデルが issue の本文から書いたものです。

説明

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);
主要言語
JavaScript
スター
217
フォーク
102
平均マージ
2日 9時間
マージ済み PR(30日)
8

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/cordova-node-xcode のほかの issue

apache/cordova-node-xcode の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。