From 0ed7ccc6c1e1d41bb7fbea3111fe509da32e50fa Mon Sep 17 00:00:00 2001 From: Horus3 Date: Mon, 30 Mar 2015 00:45:51 +0200 Subject: Improve Makefile vagrant --- Makefile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ea6cb20..a94b7cc 100644 --- a/Makefile +++ b/Makefile @@ -90,6 +90,9 @@ pack: gen_config echo "#!/bin/sh" > start.sh && \ echo ". ./_env.sh && ./$(APP)" >> start.sh && \ chmod +x start.sh && \ + if [ ! -d $(FREEMAIL_DB_DIR) ]; then \ + mkdir $(FREEMAIL_DB_DIR); \ + fi tar czf $(APP).tar.gz start.sh $(APP) _env.sh views static $(FREEMAIL_DB_DIR) 2>/dev/null && \ rm start.sh 2>/dev/null && \ echo "\n/$(APP).tar.gz is ready." || \ @@ -140,13 +143,15 @@ restart: kill build run go_get: go get github.com/jinzhu/gorm - go get github.com/mattn/go-sqlite3 go get github.com/gorilla/mux go get github.com/gorilla/schema go get github.com/gorilla/sessions + go get github.com/mattn/go-sqlite3 + go get github.com/go-sql-driver/mysql + go get github.com/lib/pq _test_archiv: - @if [ ! -f ./$(APP).tar.gz ] || [ ! -x ./$(APP).tar.gz ]; then \ + @if [ ! -f ./$(APP).tar.gz ]; then \ echo "No archive found." 1>&2; \ echo "Run \"make pack\" first." 1>&2; \ echo ""; \ @@ -160,5 +165,5 @@ _test_vagrant_env: exit 1; \ fi -vagrant: _test_archiv _test_vagrant_env +vagrant: _test_vagrant_env go_get build pack mv $(APP).tar.gz $(VAGRANT_DIR) -- cgit v1.2.3