Skip to content
Snippets Groups Projects
Commit 5ba27c8d authored by Florent Gluck's avatar Florent Gluck
Browse files

Fixed ticket #36: bug: vmimportdir creates full directory tree in the VM, which is wrong

parent 9dd65215
No related branches found
No related tags found
No related merge requests found
......@@ -66,7 +66,7 @@ func (cmd *ImportDir)Run(args []string) int {
u.PrintlnErr(err.Error())
return 1
}
tmpTarGzFile += ".tar"
tmpTarGzFile += ".tar.gz"
defer os.Remove(tmpTarGzFile)
if err := u.TarGzDir(localDir, tmpTarGzFile); err != nil {
u.PrintlnErr(err.Error())
......
......@@ -64,7 +64,9 @@ func TarGzDir(dir, archive string) error {
return err
}
header.Name = filepath.ToSlash(file)
fileRel := strings.TrimPrefix(file, dir)
fileRel = filepath.Join(filepath.Base(dir), fileRel)
header.Name = filepath.ToSlash(fileRel)
if err := tarWriter.WriteHeader(header); err != nil {
return err
......
......@@ -8,7 +8,7 @@ import (
const (
major = 1
minor = 6
bugfix = 5
bugfix = 6
)
type Version struct {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment