mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
export isDir
This commit is contained in:
parent
0df9890b8b
commit
14a168c908
1 changed files with 4 additions and 4 deletions
|
@ -38,7 +38,7 @@ type FileMetaData struct {
|
||||||
Size int
|
Size int
|
||||||
Hash string
|
Hash string
|
||||||
Path string
|
Path string
|
||||||
isDir bool
|
IsDir bool
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -74,8 +74,8 @@ func NewConnection(flags *Flags) *Connection {
|
||||||
|
|
||||||
// now, we change the target file name to match the new archive created
|
// now, we change the target file name to match the new archive created
|
||||||
flags.File = tmpTarGzFileName
|
flags.File = tmpTarGzFileName
|
||||||
// we set the value isDir to true
|
// we set the value IsDir to true
|
||||||
c.File.isDir = true
|
c.File.IsDir = true
|
||||||
fmt.Println("Done !")
|
fmt.Println("Done !")
|
||||||
c.File.Name = path.Base(tmpTarGzFileName)
|
c.File.Name = path.Base(tmpTarGzFileName)
|
||||||
} else {
|
} else {
|
||||||
|
@ -180,7 +180,7 @@ func (c *Connection) Run() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove compressed archive
|
// remove compressed archive
|
||||||
if c.File.isDir {
|
if c.File.IsDir {
|
||||||
if err := os.Remove(tmpTarGzFileName); err != nil {
|
if err := os.Remove(tmpTarGzFileName); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue