diff --git a/src/meow.tf/deb-simple/http.go b/src/meow.tf/deb-simple/http.go index c964e60..cdd26ae 100644 --- a/src/meow.tf/deb-simple/http.go +++ b/src/meow.tf/deb-simple/http.go @@ -97,6 +97,17 @@ func uploadHandler(w http.ResponseWriter, r *http.Request) { modifiedArches := make(map[string]bool) + baseDir := path.Join(os.TempDir(), "deb-simple") + + if _, err := os.Stat(baseDir); err != nil { + if os.IsNotExist(err) { + if err := os.MkdirAll(baseDir, 0755); err != nil { + httpErrorf(w, "error creating path: %s", err) + return + } + } + } + for { part, err := reader.NextPart() @@ -108,7 +119,7 @@ func uploadHandler(w http.ResponseWriter, r *http.Request) { continue } - tempFile := path.Join(os.TempDir(), "temp_" + part.FileName()) + tempFile := path.Join(baseDir, part.FileName()) dst, err := os.Create(tempFile) diff --git a/src/meow.tf/deb-simple/server.go b/src/meow.tf/deb-simple/server.go index fd5c8c9..d067b05 100644 --- a/src/meow.tf/deb-simple/server.go +++ b/src/meow.tf/deb-simple/server.go @@ -15,7 +15,7 @@ import ( "github.com/go-ini/ini" ) -var VERSION string = "1.3.2" +var VERSION string = "1.3.3" func packageName(name string) string { if index := strings.Index(name, "_"); index != -1 {