1
0
mirror of https://github.com/schollz/croc.git synced 2024-11-30 23:52:07 +03:00

Merge branch 'master' of github.com:schollz/croc

This commit is contained in:
Zack Scholl 2021-03-05 17:05:02 +00:00
commit 105fb9a3ce

View File

@ -1164,6 +1164,10 @@ func (c *Client) createEmptyFileAndFinish(fileInfo FileInfo, i int) (err error)
pathToFile := path.Join(fileInfo.FolderRemote, fileInfo.Name)
if fileInfo.Symlink != "" {
log.Debug("creating symlink")
// remove symlink if it exists
if _, errExists := os.Lstat(pathToFile); errExists == nil {
os.Remove(pathToFile)
}
err = os.Symlink(fileInfo.Symlink, pathToFile)
if err != nil {
return