aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristine Dodrill <me@christine.website>2019-03-13 07:29:28 -0700
committerChristine Dodrill <me@christine.website>2019-03-13 07:29:28 -0700
commit2616635c4fd9bb6385e1a108d47502a02b7ad2a4 (patch)
tree9143d18dc23861f2537a011ee06fda96d6ca3b80
parentf586d6e2a46037c279e727a50d87caab24ad3e33 (diff)
downloadx-2616635c4fd9bb6385e1a108d47502a02b7ad2a4.tar.xz
x-2616635c4fd9bb6385e1a108d47502a02b7ad2a4.zip
tools/appsluggr: copy translations directory to /app/translations
-rw-r--r--go.mod1
-rw-r--r--go.sum4
-rw-r--r--tools/appsluggr/main.go7
3 files changed, 12 insertions, 0 deletions
diff --git a/go.mod b/go.mod
index cf2311a..6953327 100644
--- a/go.mod
+++ b/go.mod
@@ -34,6 +34,7 @@ require (
github.com/mndrix/golog v0.0.0-20170330170653-a28e2a269775
github.com/mndrix/ps v0.0.0-20170330174427-18e65badd6ab // indirect
github.com/olekukonko/tablewriter v0.0.1 // indirect
+ github.com/otiai10/copy v1.0.1
github.com/pborman/uuid v1.2.0
github.com/peterh/liner v1.1.0
github.com/pkg/errors v0.8.1
diff --git a/go.sum b/go.sum
index cfd9948..37699d1 100644
--- a/go.sum
+++ b/go.sum
@@ -1,3 +1,4 @@
+bou.ke/monkey v1.0.1/go.mod h1:FgHuK96Rv2Nlf+0u1OOVDpCMdsWyOFmeeketDHE7LIg=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/McKael/madon/v2 v2.0.0-20180929094633-c679abc985d6 h1:9cJcTOeILzInNo+DCYmXKME1QfAP07FYdo3M9/9jyc4=
github.com/McKael/madon/v2 v2.0.0-20180929094633-c679abc985d6/go.mod h1:mvlJhxZCchfiasx3XvN3hBu5RekGwTDm09dKlSM/dQQ=
@@ -83,6 +84,9 @@ github.com/mndrix/ps v0.0.0-20170330174427-18e65badd6ab h1:fPrYMvMnWuED0MLhLyrny
github.com/mndrix/ps v0.0.0-20170330174427-18e65badd6ab/go.mod h1:dHgTaDInzkAqJv67VaX1IkK449M2UoBY68CZeI/bNCU=
github.com/olekukonko/tablewriter v0.0.1 h1:b3iUnf1v+ppJiOfNX4yxxqfWKMQPZR5yoh8urCTFX88=
github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
+github.com/otiai10/copy v1.0.1 h1:gtBjD8aq4nychvRZ2CyJvFWAw0aja+VHazDdruZKGZA=
+github.com/otiai10/copy v1.0.1/go.mod h1:8bMCJrAqOtN/d9oyh5HR7HhLQMvcGMpGdwRDYsfOCHc=
+github.com/otiai10/mint v1.2.3/go.mod h1:YnfyPNhBvnY8bW4SGQHCs/aAFhkgySlMZbrF5U0bOVw=
github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g=
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
github.com/peterh/liner v1.1.0 h1:f+aAedNJA6uk7+6rXsYBnhdo4Xux7ESLe+kcuVUF5os=
diff --git a/tools/appsluggr/main.go b/tools/appsluggr/main.go
index 94d2e10..b4701a1 100644
--- a/tools/appsluggr/main.go
+++ b/tools/appsluggr/main.go
@@ -12,6 +12,7 @@ import (
"path/filepath"
"strings"
+ "github.com/otiai10/copy"
"github.com/Xe/x/internal"
)
@@ -48,6 +49,7 @@ func main() {
os.MkdirAll(filepath.Join(dir, "bin"), 0777)
var procfile, scalefile string
+ copy.Copy("translations", filepath.Join(dir, "translations"))
if *web != "" {
procfile += "web: /app/bin/web\n"
scalefile += fmt.Sprintf("web=%d", *webScale)
@@ -78,9 +80,14 @@ func main() {
filepath.Walk(dir, func(file string, fi os.FileInfo, err error) error {
// return on any error
if err != nil {
+ log.Printf("got error on %s: %v", file, err)
return err
}
+ if fi.IsDir() {
+ return nil // not a file. ignore.
+ }
+
// create a new dir/file header
header, err := tar.FileInfoHeader(fi, fi.Name())
if err != nil {