Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quote --sourcemap-output argument during ios build #31587

Closed
wants to merge 1 commit into from
Closed

Quote --sourcemap-output argument during ios build #31587

wants to merge 1 commit into from

Commits on Sep 21, 2021

  1. Quote --sourcemap-output argument during ios build

    Scheme names may contain whitespace characters is used as path of the
    path for various files during build time. This means any path that
    includes the scheme name in it needs to be surrounded by quotes.
    
    You can see the generated command below for a project with a scheme
    called `Some Scheme`:
    
        node ./node_modules/react-native/cli.js bundle \
          --entry-file index.js \
          --platform ios \
          --dev false \
          --reset-cache \
          --bundle-output './ios/derivedDataBuild/Build/Intermediates.noindex/ArchiveIntermediates/Some Scheme/BuildProductsPath/Release-iphoneos/Some Scheme.app/main.jsbundle' \
          --assets-dest './ios/derivedDataBuild/Build/Intermediates.noindex/ArchiveIntermediates/Some Scheme/BuildProductsPath/Release-iphoneos/Some Scheme.app' \
          --sourcemap-output ./ios/derivedDataBuild/Build/Intermediates.noindex/ArchiveIntermediates/Some Scheme/BuildProductsPath/Release-iphoneos/Some Scheme.app/main.jsbundle.map
    
    `--bundle-output` and `--assets-dest` are properly quoted, but
    `--sourcemap-output` is not.
    
    This changes `$EXTRA_ARGS` to an array of strings so that we can
    propertly quote `$PACKAGER_SOURCEMAP_FILE` when passing it to the
    `--sourcemap-output` argument. When running the bundle command, this
    array is unwrapped and all its elements passed as individual arguments.
    
    It also applies the same unwrapping to `$EXTRA_PACKAGER_ARGS` so that
    users can also pass an array of options when arguments containing spaces
    are needed.
    
    It's important to note that these changes ARE backwards compatible: if
    `$EXTRA_PACKAGER_ARGS` is defined as a simple string, instead of an
    array of strings, the command won't break, as it will still expand
    correctly.
    andersonvom authored and Anderson Mesquita committed Sep 21, 2021
    Configuration menu
    Copy the full SHA
    e2c3dbd View commit details
    Browse the repository at this point in the history