forked from amitbl/blocktube
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
31 lines (26 loc) · 788 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
29
30
31
.PHONY: build clean
SHELL := /usr/bin/env bash
DEST = dist
VERSION = 0.2.9
# npm install uglify-es
build:
# copy files
mkdir -p ${DEST}
cp -R src ${DEST}/
cp -R assets ${DEST}/
cp LICENSE ${DEST}/
cp manifest.json ${DEST}/
# set version
sed -i -e "s/{EXT_VERSION}/${VERSION}/" ${DEST}/manifest.json
sed -i -e "s/{EXT_VERSION}/${VERSION}/" ${DEST}/src/ui/options.html
# insert seed into content script
pushd ${DEST}/src/scripts; \
uglifyjs --ecma 8 -o seed_.js seed.js; \
sed -i -e "s/{SEED_CONTENTS}/$$(sed 's:[/\\&]:\\&:g' seed_.js)/" content_script.js; \
rm -f seed*.js;
# zip it
pushd ${DEST}; \
zip ../blocktube.zip -qr ./*;
clean:
rm -rf ${DEST}
rm -f blocktube.zip