Skip to content

Commit

Permalink
🎨 Copy file ignore symlink
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed May 1, 2024
1 parent 3c1bb82 commit 5e7c222
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions file.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,11 @@ func (*GuluFile) copyFile(source, dest string, chtimes bool) (err error) {
return
}

if 0 == sourceinfo.Mode()&os.ModeSymlink {
// 忽略符号链接
return
}

if err = os.Chmod(dest, sourceinfo.Mode()); nil != err {
return
}
Expand Down

0 comments on commit 5e7c222

Please sign in to comment.