-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
28 lines (21 loc) · 827 Bytes
/
Makefile
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
ARCHIVE_NAME_FIREFOX = nicer-aws-accounts-firefox.xpi
ARCHIVE_NAME_CHROME = nicer-aws-accounts-chrome.zip
all: clean firefox-extension chrome-extension
./dist:
mkdir ./dist
.PHONY: test
test:
if grep 'console.log' src/*.js ; then return 1; fi
firefox-extension: test ./dist
cd src && zip -r ../dist/$(ARCHIVE_NAME_FIREFOX) .
chrome-extension: test ./dist
# Create manifest without browser_specific_settings (Fifefox config)
jq 'del(.browser_specific_settings)' src/manifest.json > src/manifest-chrome.json
# Zip the deployment archive
cd src && zip -r --exclude=manifest.json ../dist/$(ARCHIVE_NAME_CHROME) .
# Delete chrome manifest
rm -f src/manifest-chrome.json
# Rename the manifest file
printf "@ manifest-chrome.json\n@=manifest.json\n" | zipnote -w ./dist/$(ARCHIVE_NAME_CHROME)
clean:
rm -rf ./dist