cli icon indicating copy to clipboard operation
cli copied to clipboard

`upgrade` does not properly exclude files from patching when RN is within a subdirectory

Open bradjones1 opened this issue 3 years ago • 0 comments

Environment

System:
    OS: Linux 5.17 Debian GNU/Linux 10 (buster) 10 (buster)
    CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
    Memory: 435.51 MB / 15.33 GB
    Shell: 5.0.3 - /bin/bash
  Binaries:
    Node: 16.13.1 - /tmp/yarn--1654921762795-0.3391503797865518/node
    Yarn: 1.22.15 - /tmp/yarn--1654921762795-0.3391503797865518/yarn
    npm: 8.1.2 - /usr/local/bin/npm
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
  IDEs:
    Android Studio: Not Found
  Languages:
    Java: Not Found
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.68.1 => 0.68.1 
  npmGlobalPackages:
    *react-native*: Not Found

Description

When upgrading using react-native upgrade for a project which is in a subdirectory below the repository root, files which cannot be patched (e.g., because they have been edited from the prior version's defaults) are not properly excluded.

I believe this is a regression from https://github.com/react-native-community/cli/pull/272.

Reproducible Demo

Upgrade a project within a subdirectory of the project repo, with files which have changed from the prior version's defaults. Files which should be excluded will fail does not exist in index.

bradjones1 avatar Jun 11 '22 04:06 bradjones1