mirror of
https://github.com/austinried/subtracks.git
synced 2026-02-09 22:42:44 +01:00
v2
This commit is contained in:
17
scripts/arb-delete-key.js
Normal file
17
scripts/arb-delete-key.js
Normal file
@@ -0,0 +1,17 @@
|
||||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
const process = require('process')
|
||||
|
||||
const key = process.argv[2]
|
||||
|
||||
const arbDir = path.join(__dirname, '../lib/l10n')
|
||||
|
||||
const arbFiles = fs.readdirSync(arbDir)
|
||||
for (const file of arbFiles) {
|
||||
const json = JSON.parse(fs.readFileSync(path.join(arbDir, file), { encoding: 'utf8' }))
|
||||
|
||||
delete json[key]
|
||||
delete json[`@${key}`]
|
||||
|
||||
fs.writeFileSync(path.join(arbDir, file), JSON.stringify(json, null, 4))
|
||||
}
|
||||
37
scripts/arb-rename-key.js
Normal file
37
scripts/arb-rename-key.js
Normal file
@@ -0,0 +1,37 @@
|
||||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
const process = require('process')
|
||||
|
||||
const from = process.argv[2]
|
||||
const to = process.argv[3]
|
||||
|
||||
const arbDir = path.join(__dirname, '../lib/l10n')
|
||||
|
||||
const arbFiles = fs.readdirSync(arbDir)
|
||||
for (const file of arbFiles) {
|
||||
const json = JSON.parse(fs.readFileSync(path.join(arbDir, file), { encoding: 'utf8' }))
|
||||
|
||||
json[to] = json[from]
|
||||
json[`@${to}`] = json[`@${from}`]
|
||||
|
||||
delete json[from]
|
||||
delete json[`@${from}`]
|
||||
|
||||
fs.writeFileSync(path.join(arbDir, file), JSON.stringify(sortObj(json), null, 4))
|
||||
}
|
||||
|
||||
function sortObj(obj) {
|
||||
return Object.keys(obj)
|
||||
.sort((a, b) => moveSymbol(a).localeCompare(moveSymbol(b)))
|
||||
.reduce(function (result, key) {
|
||||
result[key] = obj[key]
|
||||
return result
|
||||
}, {})
|
||||
}
|
||||
|
||||
function moveSymbol(str) {
|
||||
if (str.startsWith('@')) {
|
||||
return `${str.substring(1)}@`
|
||||
}
|
||||
return str
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
dir=$(dirname "$(readlink -f "$0")")
|
||||
root=$(realpath "$dir/..")
|
||||
assets="$root/android/app/src/main/assets"
|
||||
|
||||
for filename in "$assets"/licenses/*.txt; do
|
||||
[ -e "$filename" ] || continue
|
||||
moreLicenses="$moreLicenses"'<hr/><pre style="white-space: pre-wrap;">
|
||||
'$(cat "$filename")'
|
||||
</pre>
|
||||
'
|
||||
done
|
||||
echo "$moreLicenses" > "$assets/moreLicenses"
|
||||
|
||||
awk '
|
||||
/<\/body>/ {
|
||||
system ( "cat \"'"$assets/moreLicenses"'\"" )
|
||||
}
|
||||
{ print }
|
||||
' "$assets/licenses.html" > "$assets/output.html"
|
||||
|
||||
mv "$assets/output.html" "$assets/licenses.html"
|
||||
rm "$assets/moreLicenses"
|
||||
@@ -1,34 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
dir=$(dirname "$(readlink -f "$0")")
|
||||
root=$(realpath "$dir/..")
|
||||
|
||||
FFMPEG_EXT_PATH="$root/submodules/ExoPlayer/extensions/ffmpeg/src/main/jni"
|
||||
HOST_PLATFORM="linux-x86_64"
|
||||
ENABLED_DECODERS=(alac)
|
||||
|
||||
ndkLocalPath="$root/ndk/android-ndk-r21e"
|
||||
ndkDownloadZip="$root/ndk/ndk.zip"
|
||||
|
||||
if [ -z "$NDK_PATH" ] && [ ! -e "$ndkLocalPath" ]; then
|
||||
mkdir -p "$root/ndk"
|
||||
|
||||
echo "downloading android-ndk-r21e-linux-x86_64.zip to $ndkDownloadZip..."
|
||||
wget -nv https://dl.google.com/android/repository/android-ndk-r21e-linux-x86_64.zip -O "$ndkDownloadZip"
|
||||
echo "done!"
|
||||
|
||||
echo "extracting $ndkDownloadZip..."
|
||||
unzip -q -d "$root/ndk" "$ndkDownloadZip"
|
||||
echo "done!"
|
||||
|
||||
rm "$ndkDownloadZip"
|
||||
fi
|
||||
|
||||
if [ -z "$NDK_PATH" ] && [ -e "$ndkLocalPath" ]; then
|
||||
NDK_PATH="$root/ndk/android-ndk-r21e"
|
||||
fi
|
||||
|
||||
cd "${FFMPEG_EXT_PATH}"
|
||||
./build_ffmpeg.sh "${FFMPEG_EXT_PATH}" "${NDK_PATH}" "${HOST_PLATFORM}" "${ENABLED_DECODERS[@]}"
|
||||
"${NDK_PATH}/ndk-build" APP_ABI="armeabi-v7a arm64-v8a x86 x86_64" -j4
|
||||
Reference in New Issue
Block a user