Add Gecko types and a script to update them (#4296)

This commit is contained in:
Abe Jellinek 2024-07-02 00:58:51 -04:00 committed by GitHub
parent 3a59a68779
commit cd5df6b2c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 53668 additions and 0 deletions

22
scripts/update-types.sh Executable file
View file

@ -0,0 +1,22 @@
#!/bin/bash -e
set -e pipefail
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="$(dirname "$SCRIPT_DIR")"
release=esr128 # TODO: Keep in sync with platform version once platform version >= esr128
if [ -n "$1" ]; then
tag=$1
fi
echo Downloading types from release $release
DIR_REMOTE="https://hg.mozilla.org/releases/mozilla-$release/raw-file/tip/tools/@types"
DIR_LOCAL="$ROOT_DIR/types/gecko"
dir_listing=$(curl -fs "$DIR_REMOTE")
filenames=$(cut -d ' ' -f 3 <<< "$dir_listing")
for filename in $filenames; do
curl -f "$DIR_REMOTE/$filename" > "$DIR_LOCAL/$filename"
sed -i '' '/^\/\/\/ <reference no-default-lib="true" \/>/d' "$DIR_LOCAL/$filename"
done