This repository has been archived by the owner on Dec 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild
executable file
·40 lines (32 loc) · 1.46 KB
/
build
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
#!/bin/bash
#
# This file is part of AdStopEnforcer.
#
# AdStopEnforcer is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# AdStopEnforcer is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with AdStopEnforcer. If not, see <http://www.gnu.org/licenses/>.
#
BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
BUILD_DIR="$BASE_DIR/target"
CHROME_BUILD_DIR="$BUILD_DIR/chrome"
FIREFOX_BUILD_DIR="$BUILD_DIR/firefox"
MANIFEST="manifest.json"
if [ "$1" = "test" ]; then MANIFEST="test.$MANIFEST"; fi
rm -rf "$BUILD_DIR"
test -d "$CHROME_BUILD_DIR" || mkdir -p "$CHROME_BUILD_DIR"
test -d "$FIREFOX_BUILD_DIR" || mkdir -p "$FIREFOX_BUILD_DIR"
cp -r icons engine background popup "chrome.$MANIFEST" "$CHROME_BUILD_DIR"
cp -r icons engine background popup "firefox.$MANIFEST" "$FIREFOX_BUILD_DIR"
mv "$CHROME_BUILD_DIR/chrome.$MANIFEST" "$CHROME_BUILD_DIR/manifest.json"
mv "$FIREFOX_BUILD_DIR/firefox.$MANIFEST" "$FIREFOX_BUILD_DIR/manifest.json"
cd "$CHROME_BUILD_DIR" && zip ../chrome.zip -r .
cd "$FIREFOX_BUILD_DIR" && zip ../firefox.xpi -r .