<commit_before>#!/usr/bin/env bash
echo "#### appcenter-post-build START ####"

npm install --global react-native-cli
npm install --global bugsnag-sourcemaps

# Debug
echo "Current dir - START:"
pwd
ls -la
echo "Bundle File: $BUNDLE_FILE"

if [ -n "$APPCENTER_XCODE_PROJECT" ]
then
    echo "Generating React Native bundle for iOS..."
    react-native bundle \
        --platform ios \
        --dev false \
        --entry-file index.js \
        --bundle-output ios-release.bundle \
        --sourcemap-output ios-release.bundle.map
    
    echo "Uploading source map for iOS..."
    bugsnag-sourcemaps upload \
        --api-key $BUGSNAG_KEY \
        --code-bundle-id $APPCENTER_BUILD_ID \
        --source-map ios-release.bundle.map \
        --minified-url main.jsbundles \
        --minified-file ios-release.bundle \
        --upload-sources
else
    echo "Generating React Native bundle for Android..."
    react-native bundle \
        --platform android \
        --dev false \
        --entry-file index.js \
        --bundle-output android-release.bundle \
        --sourcemap-output android-release.bundle.map

    echo "Uploading source map for Android..."
    bugsnag-sourcemaps upload \
        --api-key $BUGSNAG_KEY \
        --code-bundle-id $APPCENTER_BUILD_ID \
        --source-map android-release.bundle.map \
        --minified-url app/build/generated/assets/react/release/index.android.bundles \
        --minified-file android-release.bundle \
        --upload-sources
fi

echo '## APPCENTER SOURCE:'
find $APPCENTER_SOURCE_DIRECTORY

echo '## APPCENTER OUTPUT:'
find $APPCENTER_OUTPUT_DIRECTORY


echo "Current dir - END:"
pwd
ls -la

echo "## APPCENTER_REACTNATIVE_PACKAGE: $APPCENTER_REACTNATIVE_PACKAGE"

echo "#### appcenter-post-build END ####"<commit_msg>update post build script p10<commit_after>#!/usr/bin/env bash
echo "#### appcenter-post-build START ####"

npm install --global react-native-cli
npm install --global bugsnag-sourcemaps

if [ -n "$APPCENTER_XCODE_PROJECT" ]
then
    echo "Generating React Native bundle for iOS..."
    react-native bundle \
        --platform ios \
        --dev false \
        --entry-file index.js \
        --bundle-output ios-release.bundle \
        --sourcemap-output ios-release.bundle.map
    
    echo "Uploading source map for iOS..."
    bugsnag-sourcemaps upload \
        --api-key $BUGSNAG_KEY \
        --code-bundle-id $APPCENTER_BUILD_ID \
        --source-map ios-release.bundle.map \
        --minified-url /Users/vsts/Library/Developer/Xcode/DerivedData/CampusMobile-*/Build/Intermediates.noindex/ArchiveIntermediates/CampusMobile/BuildProductsPath/Release-iphoneos/CampusMobile.app/main.jsbundle \
        --minified-file ios-release.bundle \
        --upload-sources \
        --add-wildcard-prefix
else
    echo "Generating React Native bundle for Android..."
    react-native bundle \
        --platform android \
        --dev false \
        --entry-file index.js \
        --bundle-output android-release.bundle \
        --sourcemap-output android-release.bundle.map

    echo "Uploading source map for Android..."
    bugsnag-sourcemaps upload \
        --api-key $BUGSNAG_KEY \
        --code-bundle-id $APPCENTER_BUILD_ID \
        --source-map android-release.bundle.map \
        --minified-url app/build/generated/assets/react/release/index.android.bundle \
        --minified-file android-release.bundle \
        --upload-sources \
        --add-wildcard-prefix
fi

echo '## IOS:'
find /Users/vsts/Library/Developer/Xcode/DerivedData

echo '## APPCENTER OUTPUT:'
find app/build

echo "#### appcenter-post-build END ####"
{'fraction_non_alphanumeric': 0.12672176308539945, 'fraction_numerical': 0.0005509641873278236, 'mean_word_length': 2.29491833030853, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5359521', 'n_tokens_mistral': 1143, 'n_tokens_neox': 1124, 'n_words': 243}