Skip to content

Commit 98d1696

Browse files
committed
Fix grep commands in android sourcemap upload script
1 parent f3dd1cf commit 98d1696

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

android/upload_sourcemap.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@ export NODE_BINARY=node
1111

1212
if [ ! "${INSTABUG_APP_TOKEN}" ] || [ -z "${INSTABUG_APP_TOKEN}" ]; then
1313
echo "Instabug: Looking for Token..."
14-
INSTABUG_APP_TOKEN=$(grep -r --exclude-dir={node_modules,ios,android} "Instabug.start[WithToken]*([\"\'][0-9a-zA-Z]*[\"\']" ./ -m 1 | grep -o "[\"\'][0-9a-zA-Z]*[\"\']" | cut -d "\"" -f 2 | cut -d "'" -f 2)
14+
INSTABUG_APP_TOKEN=$(grep -r --exclude-dir={node_modules,ios,android} --exclude='*.json' "Instabug.start[WithToken]*([\"\'][0-9a-zA-Z]*[\"\']" ./ -m 1 | grep -o "[\"\'][0-9a-zA-Z]*[\"\']" | cut -d "\"" -f 2 | cut -d "'" -f 2)
1515
fi
1616

1717
if [ ! "${INSTABUG_APP_TOKEN}" ] || [ -z "${INSTABUG_APP_TOKEN}" ]; then
1818
echo "Instabug: err: INSTABUG_APP_TOKEN not found. Make sure you've added the SDK initialization line Instabug.start Or added the environment variable INSTABUG_APP_TOKEN"
1919
exit 0
2020
else
2121
if [ ! "${INSTABUG_APP_VERSION_CODE}" ] || [ -z "${INSTABUG_APP_VERSION_CODE}" ]; then
22-
INSTABUG_APP_VERSION_CODE=$(grep -o "versionCode\s\+\d\+" android/app/build.gradle | awk '{ print $2 }')
22+
INSTABUG_APP_VERSION_CODE=$(grep -o "versionCode\s\+\d\+" android/app/build.gradle -m 1 | awk '{ print $2 }')
2323
if [ ! "${INSTABUG_APP_VERSION_CODE}" ] || [ -z "${INSTABUG_APP_VERSION_CODE}" ]; then
2424
echo "versionCode could not be found, please upload the sourcemap files manually"
2525
exit 0
2626
fi
2727
fi
2828
if [ ! "${INSTABUG_APP_VERSION_NAME}" ] || [ -z "${INSTABUG_APP_VERSION_NAME}" ]; then
29-
INSTABUG_APP_VERSION_NAME=$(grep "versionName" android/app/build.gradle | awk '{print $2}' | tr -d \''"\')
29+
INSTABUG_APP_VERSION_NAME=$(grep "versionName" android/app/build.gradle -m 1 | awk '{print $2}' | tr -d \''"\')
3030
if [ ! "${INSTABUG_APP_VERSION_NAME}" ] || [ -z "${INSTABUG_APP_VERSION_NAME}" ]; then
3131
echo "versionName could not be found, please upload the sourcemap files manually"
3232
exit 0
@@ -37,7 +37,7 @@ else
3737
echo "Instabug: Version Code found" "\""${INSTABUG_APP_VERSION_CODE}"\""
3838
echo "Instabug: Version Name found" "\""${INSTABUG_APP_VERSION_NAME}"\""
3939
echo "Instabug: Generating sourcemap files..."
40-
IS_HERMES=$(grep "enableHermes:" ./android/app/build.gradle)
40+
IS_HERMES=$(grep "enableHermes:" ./android/app/build.gradle -m 1)
4141
if [[ $IS_HERMES == *"true"* ]]; then
4242
#Generate android sourcemap (HERMES)
4343
react-native bundle --platform android \

0 commit comments

Comments
 (0)