]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - scripts/build/client.sh
aa3f89c03324789798bbd7f9713a902bc3dc2d58
8 mkdir "./src/pending_locale" > /dev
/null
|| true
9 mv .
/src
/locale
/angular.
*.xlf
"./src/pending_locale"
11 if [ ! -z ${1+x} ]; then
12 mv "./src/pending_locale/angular.$1.xlf" "./src/locale"
17 mv .
/src
/pending_locale
/* "./src/locale"
18 rmdir "./src/pending_locale/"
21 # Previous build failed
22 if [ ! -f "client/src/locale/angular.fr-FR.xlf" ]; then
23 git checkout
-- client
/src
/locale
/
24 rm -r client
/src
/pending_locale
29 rm -rf .
/dist .
/compiled
33 defaultLanguage
="en-US"
34 npm run ng build
-- --output-path "dist/$defaultLanguage/" --deploy-url "/client/$defaultLanguage/" --prod --stats-json
35 mv "./dist/$defaultLanguage/assets" "./dist"
36 mv "./dist/$defaultLanguage/manifest.webmanifest" "./dist/manifest.webmanifest"
40 # Don't build other languages if --light arg is provided
41 if [ -z ${1+x} ] || [ "$1" != "--light" ]; then
42 if [ ! -z ${1+x} ] && [ "$1" == "--light-fr" ]; then
43 languages
=(["fr"]="fr-FR")
60 ["zh-Hans"]="zh-Hans-CN"
61 ["zh-Hant"]="zh-Hant-TW"
73 for key
in "${!languages[@]}"; do
74 lang
=${languages[$key]}
76 # TODO: remove when the project will use runtime translations
77 pre_build_hook
"$lang"
79 npm run ng build
-- --prod --configuration="$lang"
81 if [ ! "$lang" = "$key" ]; then
82 mv "dist/$key" "dist/$lang"
85 # Do not duplicate assets
86 rm -r "./dist/$lang/assets"
88 # TODO: remove when the project will use runtime translations
93 cd ..
/ && npm run build
:embed
&& cd client
/
95 # Copy runtime locales
96 cp -r "./src/locale" "./dist/locale"