diff --git a/Gopkg.lock b/Gopkg.lock index fbb82319..7208372d 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -52,8 +52,8 @@ [[projects]] name = "github.com/schollz/tarinator-go" packages = ["."] - revision = "835680f17d252bd7a6047e670079f35e5626dc1e" - version = "v0.1.0" + revision = "a8626a55d48dbb55141e51226eefa15c157a65a8" + version = "v0.3.3" [[projects]] name = "github.com/sirupsen/logrus" diff --git a/connect.go b/connect.go index 905e3f62..4325a3ba 100644 --- a/connect.go +++ b/connect.go @@ -253,7 +253,7 @@ func (c *Connection) Run() error { } if c.Local { - fmt.Fprintf(os.Stderr, "Receive with: croc --code 8-local --server %s --yes\n", GetLocalIP()) + fmt.Fprintf(os.Stderr, "Receive with: croc --code %s --server %s --yes\n", c.Code, GetLocalIP()) } else { fmt.Fprintf(os.Stderr, "Code is: %s\n", c.Code) } diff --git a/vendor/github.com/schollz/tarinator-go/tarinator.go b/vendor/github.com/schollz/tarinator-go/tarinator.go index 0725ef2e..233643d0 100644 --- a/vendor/github.com/schollz/tarinator-go/tarinator.go +++ b/vendor/github.com/schollz/tarinator-go/tarinator.go @@ -39,6 +39,13 @@ func Tarinate(paths []string, tarPath string) error { } func tarwalk(source, target string, tw *tar.Writer) error { + source = filepath.ToSlash(source) + if len(source) > 0 { + if source[0:2] == "./" { + source = source[2:] + } + } + info, err := os.Stat(source) if err != nil { return nil @@ -46,7 +53,8 @@ func tarwalk(source, target string, tw *tar.Writer) error { var baseDir string if info.IsDir() { - baseDir = filepath.Base(source) + baseDir = filepath.ToSlash(filepath.Base(source)) + } return filepath.Walk(source, @@ -59,6 +67,7 @@ func tarwalk(source, target string, tw *tar.Writer) error { return err } + path = filepath.ToSlash(path) if baseDir != "" { header.Name = filepath.ToSlash(filepath.Join(baseDir, strings.TrimPrefix(path, source))) } @@ -104,7 +113,7 @@ func UnTarinate(extractPath, sourcefile string) error { } tarBallReader := tar.NewReader(fileReader) - + extractPath = filepath.FromSlash(extractPath) for { header, err := tarBallReader.Next() if err != nil { diff --git a/vendor/github.com/schollz/tarinator-go/tarinator_test.go b/vendor/github.com/schollz/tarinator-go/tarinator_test.go index 28d78037..068e8dfb 100644 --- a/vendor/github.com/schollz/tarinator-go/tarinator_test.go +++ b/vendor/github.com/schollz/tarinator-go/tarinator_test.go @@ -9,7 +9,7 @@ import ( func TestArchive(t *testing.T) { paths := []string{ "somescript.sh", - "test_files/", + "./test_files/", } err := Tarinate(paths, "output_test.tar.gz") diff --git a/vendor/github.com/schollz/tarinator-go/test_files/.dotfile b/vendor/github.com/schollz/tarinator-go/test_files/.dotfile new file mode 100644 index 00000000..e69de29b