forked from mozilla-mobile/firefox-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·51 lines (42 loc) · 1.29 KB
/
bootstrap.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#
# Bootstrap the Carthage dependencies. If the Carthage directory
# already exists then nothing is done. This speeds up builds on
# CI services where the Carthage directory can be cached.
#
# Use the --force option to force a rebuild of the dependencies.
# Use the --locale option to fetch and update locales only
#
getLocale()
{
echo "Getting locale..."
git clone https://github.com/mozilla-mobile/ios-l10n-scripts.git
./ios-l10n-scripts/import-locales-firefox.sh
}
if [ "$1" == "--locale" ]; then
getLocale
exit 0
fi
if [ "$1" == "--force" ]; then
rm -rf firefoxios-l10n
rm -rf ios-l10n-scripts
rm -rf Carthage/*
rm -rf ~/Library/Caches/org.carthage.CarthageKit
fi
# Import locales
if [ -d "/firefoxios-l10n" ] && [ -d "/ios-l10n-scripts" ]; then
echo "l10n directories found. Not downloading scripts."
else
echo "l10n directory not found. Downloading repo and scripts."
getLocale
fi
# Run carthage
./carthage_command.sh
# Install Node.js dependencies and build user scripts
npm install
npm run build
(cd content-blocker-lib-ios/ContentBlockerGen && swift run)