mirror of
https://github.com/Jellify-Music/App.git
synced 2026-01-06 02:50:30 -06:00
Nitro OTA Package (#560)
Adds internal over-the-air update support Powered by `react-native-nitro-modules`, this OTA functionality is faster than the previous implementation, and won't slow down the UI when updates are being applied since updates occur off the main thread
This commit is contained in:
40
scripts/getRandomVersion.sh
Normal file
40
scripts/getRandomVersion.sh
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
FILE="ota.version"
|
||||
|
||||
# Array of sentences
|
||||
sentences=(
|
||||
"Git Blame violet"
|
||||
"Thank you pikachu"
|
||||
"Margelo folks are Awesome"
|
||||
"Pikachu Should have coded this"
|
||||
"meta sue violet"
|
||||
)
|
||||
|
||||
# Read previous value if file exists
|
||||
prev=""
|
||||
if [[ -f "$FILE" ]]; then
|
||||
prev=$(<"$FILE")
|
||||
fi
|
||||
|
||||
# Function to get a random new sentence (not same as prev)
|
||||
get_random_sentence() {
|
||||
local choice
|
||||
while true; do
|
||||
choice="${sentences[RANDOM % ${#sentences[@]}]}"
|
||||
if [[ "$choice" != "$prev" ]]; then
|
||||
echo "$choice"
|
||||
return
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
new_sentence=$(get_random_sentence)
|
||||
|
||||
# Write atomically
|
||||
tmp="${FILE}.tmp.$$"
|
||||
echo "$new_sentence" > "$tmp"
|
||||
mv "$tmp" "$FILE"
|
||||
|
||||
echo "✅ Updated $FILE with: \"$new_sentence\""
|
||||
Reference in New Issue
Block a user