From 907c310c019c4d5e9f79cb42d353f1309bdd5420 Mon Sep 17 00:00:00 2001 From: Deluan Date: Wed, 8 Jan 2020 11:13:05 -0500 Subject: [PATCH] Download Jamstash in `make setup` --- .gitignore | 5 +++-- Makefile | 9 +++++++-- app.go | 6 +++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 26981051..aa592f7f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ /sonic-server /iTunes*.xml -static/Jamstash devDb /tmp vendor/*/ @@ -8,4 +7,6 @@ wiki TODO.md var Artwork -sonic.toml \ No newline at end of file +sonic.toml +master.zip +Jamstash-master diff --git a/Makefile b/Makefile index 2fc36673..e689b148 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ clean: rm -f ${BINARY} .PHONY: setup -setup: +setup: jamstash @which reflex || (echo "Installing Reflex" && GO111MODULE=off go get -u github.com/cespare/reflex) @which goconvey || (echo "Installing GoConvey" && GO111MODULE=off go get -u github.com/smartystreets/goconvey) @which wire || (echo "Installing Wire" && GO111MODULE=off go get -u go get github.com/google/wire/cmd/wire) @@ -16,7 +16,7 @@ setup: .PHONY: run run: - @reflex -s -r "(\.go$$|sonic.toml)" -- go run . + @reflex -s -r "(\.go$$|sonic.toml)" -R "Jamstash-master" -- go run . .PHONY: test test: @@ -30,3 +30,8 @@ convey: cloc: # cloc can be installed using brew cloc --exclude-dir=devDb,.idea,.vscode,wiki,static --exclude-ext=iml,xml . + +jamstash: + wget -N https://github.com/tsquillario/Jamstash/archive/master.zip + unzip -o master.zip + rm master.zip diff --git a/app.go b/app.go index ff720fad..eaa38d8c 100644 --- a/app.go +++ b/app.go @@ -48,11 +48,11 @@ func (a *App) initRoutes() { r.Use(middleware.Heartbeat("/ping")) r.Get("/", func(w http.ResponseWriter, r *http.Request) { - http.Redirect(w, r, "/static/Jamstash", 302) + http.Redirect(w, r, "/Jamstash", 302) }) workDir, _ := os.Getwd() - filesDir := filepath.Join(workDir, "static") - FileServer(r, "/static", http.Dir(filesDir)) + filesDir := filepath.Join(workDir, "Jamstash-master/dist") + FileServer(r, "/Jamstash", http.Dir(filesDir)) a.router = r }