From 2372455e228d8b7e73c5137c0f361da8e8380740 Mon Sep 17 00:00:00 2001 From: Kelvin Ly Date: Sun, 16 Feb 2020 09:04:25 -0500 Subject: [PATCH] Change resume path to be within static directory, update submodules during static webhook updates --- main.go | 7 +++++-- static | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index d882300..5e0fb13 100644 --- a/main.go +++ b/main.go @@ -182,7 +182,6 @@ func startServer(srv *http.Server) { serveMux.HandleFunc("/", rootHandler) //serveMux.Handle("/certbot/", http.StripPrefix("/certbot/", http.FileServer(http.Dir("./certbot-tmp")))) serveMux.Handle("/gfm/", http.StripPrefix("/gfm", http.FileServer(gfmstyle.Assets))) - serveMux.Handle("/resume/", http.StripPrefix("/resume", http.FileServer(http.Dir("resume/")))) serveMux.Handle("/resize/", Cache(Resize(640, http.StripPrefix("/resize", http.FileServer(http.Dir("static/")))))) serveMux.HandleFunc("/main.css", func(w http.ResponseWriter, r *http.Request) { http.ServeFile(w, r, "main.css") }) if webhookKey != nil { @@ -229,10 +228,14 @@ func startServer(srv *http.Server) { } // TODO parse payload - pullCmd := exec.Command("git", "pull") + pullCmd := exec.Command("git", "pull", "--recurse-submodules") pullCmd.Dir = "./static/" _ = pullCmd.Run() + updateCmd := exec.Command("git", "submodule", "update", "--remote") + updateCmd.Dir = "./static/" + _ = updateCmd.Run() + w.Write([]byte("success")) }) } diff --git a/static b/static index ef94b77..ded1375 160000 --- a/static +++ b/static @@ -1 +1 @@ -Subproject commit ef94b776f38baf395f9e4ceaa98c1be286578115 +Subproject commit ded137546cc8b0ed3f27fd3f01b8a04172e6425c