forked from mozilla-extensions/firefox-translations
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathimport-models.sh
executable file
·34 lines (29 loc) · 1003 Bytes
/
import-models.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
# Usage: ./import-models.sh
set -e
# set -x
echo "* Checkout out the relevant revision of the firefox-translations-models repo"
MODELS_UPDATED=0
MODELS_GIT_REV="b22ca725bb102c034dabf3871d7349f2aca8d73d" # v0.2.10
if [ ! -d "firefox-translations-models" ]; then
git clone --branch main --single-branch https://github.com/mozilla/firefox-translations-models
MODELS_UPDATED=1
fi
cd firefox-translations-models
if [ $(git rev-parse HEAD) != "$MODELS_GIT_REV" ]; then
git fetch
git checkout $MODELS_GIT_REV
MODELS_UPDATED=1
fi
cd -
if [ "$MODELS_UPDATED" == "1" ]; then
echo "* Importing model files from firefox-translations-models repo"
mkdir -p test/locally-hosted-files/models
mv test/locally-hosted-files/models/dummy tmp
rm -rf test/locally-hosted-files/models/*
cp -rf firefox-translations-models/models/*/* test/locally-hosted-files/models
ls -l test/locally-hosted-files/models/*
mv tmp test/locally-hosted-files/models/dummy
fi
echo "* Done"
exit 0