-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (31 loc) · 1.11 KB
/
Makefile
File metadata and controls
37 lines (31 loc) · 1.11 KB
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
SHELL:=/bin/bash
all: compile copy files_to_cache_array
compile:
tsc
files_to_cache_array:
$(eval temp_file := $(shell mktemp))
$(eval temp_file2 := $(shell mktemp))
bash files_to_cache.sh > $(temp_file)
cat dist/service_worker.js | sed '/FILES_TO_CACHE/r $(temp_file)' | sed 's/export default null;//' > $(temp_file2)
mv $(temp_file2) dist/service_worker.js
rm $(temp_file)
copy:
mkdir -p dist
$(shell cat index.html | sed "s/G2D_STRIPE_PUBLIC_KEY/$$G2D_STRIPE_PUBLIC_KEY/" | sed "s/G2D_STRIPE_SKU_2/$$G2D_STRIPE_SKU_2/" | sed "s/G2D_STRIPE_SKU_5/$$G2D_STRIPE_SKU_5/" | sed "s/G2D_STRIPE_SKU_10/$$G2D_STRIPE_SKU_10/" > dist/index.html)
cp thanks.html dist
cp main.css dist
cp manifest.webmanifest dist
#cp *.ts dist
cp -a assets dist
cp -a --parents */assets dist
cp -a --parents */*.html dist
# cp -a --parents */*.ts dist
cp -a --parents */*.js dist
cp -r phaser* dist
cp -a --parents */*.webmanifest dist
rm -rf dist/dist
local: compile copy
-kill $$(lsof -ti :8003)
cd dist; python3 -m http.server 8003&
tsc --watch
# ag -l | entr -r -s 'make compile; make copy; cd dist; python3 -m http.server 8003'