From 35d8a5094d1f3db360fd9cd13122459915b8ad27 Mon Sep 17 00:00:00 2001 From: Ambrose Chua Date: Sat, 31 Oct 2020 00:57:37 +0800 Subject: [PATCH] Cleanup --- Caddyfile | 5 ----- Makefile | 22 ++++++++++++---------- generate.go | 3 --- 3 files changed, 12 insertions(+), 18 deletions(-) delete mode 100644 Caddyfile delete mode 100644 generate.go diff --git a/Caddyfile b/Caddyfile deleted file mode 100644 index 5239a86..0000000 --- a/Caddyfile +++ /dev/null @@ -1,5 +0,0 @@ -:2015 { - root . - file_server - try_files {path} templates/{path} templates/{path}/index.html -} diff --git a/Makefile b/Makefile index 390d5c6..bcc1f67 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,13 @@ GO = go DOWNLOAD = wget --quiet --output-document -UNZIP = unzip +UNZIP = unzip -d MKDIR = mkdir -p .PHONY: all -all: download-data download-icons generate build +all: download-icons data build + .PHONY: clean clean: $(RM) -r datetime js/data.json data/ templates/icon_*.svg @@ -19,20 +20,21 @@ datetime: *.go $(GO) build -o datetime -.PHONY: generate -generate: js/data.json +DATASETS = \ + data/cities15000.txt \ + data/admin1CodesASCII.txt \ + data/countryInfo.txt -js/data.json: generate.go scripts/data.go - $(GO) generate +.PHONY: data +data: js/data.json - -.PHONY: download-data -download-data: data/cities15000.txt data/countryInfo.txt data/admin1CodesASCII.txt +js/data.json: $(DATASETS) scripts/data.go + $(GO) run scripts/data.go data/cities15000.txt: $(MKDIR) data/ $(DOWNLOAD) data/cities15000.zip http://download.geonames.org/export/dump/cities15000.zip - $(UNZIP) data/cities15000.zip -d data/ + $(UNZIP) data/ data/cities15000.zip $(RM) data/cities15000.zip data/countryInfo.txt: diff --git a/generate.go b/generate.go deleted file mode 100644 index 1b17bcb..0000000 --- a/generate.go +++ /dev/null @@ -1,3 +0,0 @@ -package main - -//go:generate go run scripts/data.go