Skip to content

Commit 0e004a7

Browse files
committed
convert code to string before writing
1 parent 3b08eba commit 0e004a7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

extract-expose-version.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

3-
# Extract Android version code
4-
ANDROID_VERSION_CODE=$(grep "versionCode" app/build.gradle.kts | sed 's/.*versionCode\s*=\s*\([0-9]*\).*/\1/')
3+
# Extract Android version code as string
4+
ANDROID_VERSION_CODE=$(grep "versionCode" app/build.gradle.kts | sed 's/.*versionCode\s*=\s*\([0-9]*\).*/\1/' | awk '{print $0+0}')
55
if [ -z "$ANDROID_VERSION_CODE" ]; then
66
echo "Error: Unable to extract version code."
77
exit 1
@@ -15,7 +15,7 @@ if [ -z "$ANDROID_VERSION_NAME" ]; then
1515
fi
1616

1717
# Write the extracted values to a temporary file
18-
echo "ANDROID_VERSION_CODE: $ANDROID_VERSION_CODE" > extracted_values.txt
18+
echo "ANDROID_VERSION_CODE=$ANDROID_VERSION_CODE" > extracted_values.txt
1919
echo "ANDROID_VERSION_NAME=$ANDROID_VERSION_NAME" >> extracted_values.txt
2020

2121
# Debugging output to indicate script completion

0 commit comments

Comments
 (0)