Download Jamstash in `make setup`

This commit is contained in:
Deluan 2020-01-08 11:13:05 -05:00 committed by Deluan Quintão
parent 23e38ec82f
commit 907c310c01
3 changed files with 13 additions and 7 deletions

5
.gitignore vendored
View File

@ -1,6 +1,5 @@
/sonic-server
/iTunes*.xml
static/Jamstash
devDb
/tmp
vendor/*/
@ -8,4 +7,6 @@ wiki
TODO.md
var
Artwork
sonic.toml
sonic.toml
master.zip
Jamstash-master

View File

@ -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

6
app.go
View File

@ -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
}