ADD: display built branch on about screen

This commit is contained in:
Overtorment 2021-09-13 14:22:00 +01:00
parent 068627fa7b
commit 94675a9e4e
No known key found for this signature in database
GPG Key ID: AB15F43F78CCBC06
4 changed files with 13 additions and 2 deletions

1
.gitignore vendored
View File

@ -58,6 +58,7 @@ buck-out/
#BlueWallet
release-notes.json
release-notes.txt
current-branch.json
ios/Pods/

View File

@ -48,12 +48,13 @@
"clean": "cd android/; ./gradlew clean; cd ..; rm -r -f /tmp/metro-cache/; rm -r -f node_modules/; npm cache clean --force; npm i; npm start -- --reset-cache",
"clean:ios": "rm -fr node_modules && rm -fr ios/Pods && npm i && cd ios && pod update && cd ..; npm start -- --reset-cache",
"releasenotes2json": "./scripts/release-notes.sh > release-notes.txt; node -e 'console.log(JSON.stringify(require(\"fs\").readFileSync(\"release-notes.txt\", \"utf8\")));' > release-notes.json",
"branch2json": "./scripts/current-branch.sh > current-branch.json",
"podinstall": "./scripts/podinstall.sh",
"start": "node node_modules/react-native/local-cli/cli.js start",
"android": "react-native run-android",
"android:clean": "cd android; ./gradlew clean ; cd .. ; npm run android",
"ios": "react-native run-ios",
"postinstall": "rn-nodeify --install buffer,events,process,stream,util,inherits,fs,path,assert,crypto --hack; npm run releasenotes2json; npm run podinstall",
"postinstall": "rn-nodeify --install buffer,events,process,stream,util,inherits,fs,path,assert,crypto --hack; npm run releasenotes2json; npm run branch2json; npm run podinstall",
"test": "npm run tslint && npm run lint && npm run unit && npm run jest",
"jest": "jest -b -w 1 tests/integration/*",
"windowspatches": "./scripts/windows-patches.sh",

View File

@ -12,6 +12,7 @@ import Clipboard from '@react-native-clipboard/clipboard';
import { BlueStorageContext } from '../../blue_modules/storage-context';
const A = require('../../blue_modules/analytics');
const branch = require('../../current-branch.json');
const About = () => {
const { navigate } = useNavigation();
@ -210,7 +211,7 @@ const About = () => {
<BlueSpacing20 />
<BlueSpacing20 />
<BlueTextCentered>
{getApplicationName()} ver {getVersion()} (build {getBuildNumber()})
{getApplicationName()} ver {getVersion()} (build {getBuildNumber() + ' ' + branch})
</BlueTextCentered>
<BlueTextCentered>{new Date(getBuildNumber() * 1000).toGMTString()}</BlueTextCentered>
<BlueTextCentered>{getBundleId()}</BlueTextCentered>

8
scripts/current-branch.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
BRANCH1=`git log -n 1 --pretty=%d HEAD | awk '{print $2}' | sed 's/origin\///' | sed 's/)//'`
if [ "$BRANCH1" = '->' ]
then
BRANCH1=`git rev-parse --abbrev-ref HEAD`
fi
echo \"$BRANCH1\"