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