Fix early out behavior on file export
This commit is contained in:
parent
a6226fc79b
commit
e751d70f27
4
file.go
4
file.go
@ -101,11 +101,9 @@ func (file *File) GoString() string {
|
|||||||
func (file *File) export(targetDir string) error {
|
func (file *File) export(targetDir string) error {
|
||||||
targetPath := filepath.Join(targetDir, file.sourcePath)
|
targetPath := filepath.Join(targetDir, file.sourcePath)
|
||||||
|
|
||||||
if len(file.dataPath) == 0 {
|
if targetInfo, err := os.Stat(targetPath); err == nil && !targetInfo.ModTime().Before(file.ModTime()) {
|
||||||
if targetInfo, err := os.Stat(targetPath); err == nil && targetInfo.ModTime().After(file.ModTime()) {
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if err := os.MkdirAll(path.Dir(targetPath), 0755); err != nil {
|
if err := os.MkdirAll(path.Dir(targetPath), 0755); err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user