Skip to content

Commit

Permalink
error creating symlink when file exists fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
kardapoltsev committed Nov 25, 2013
1 parent 51e94fb commit fcdb8cb
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ object LinuxSymlink {
val linkFinal =
if(relativeLinks) makeRelative(link.destination, link.link)
else addFirstSlash(link.destination)
// TODO - if it already exists, delete it, or check accuracy...
if(!to.exists) Process(Seq("ln", "-s", linkFinal, name), linkDir).! match {
// from ln man page
// -f --force remove existing destination files
if(!to.exists) Process(Seq("ln", "-sf", linkFinal, name), linkDir).! match {
case 0 => ()
case n => sys.error("Failed to symlink " + link.destination + " to " + to)
}
Expand Down

0 comments on commit fcdb8cb

Please sign in to comment.