Prevent crash when symlink already exists in $nimbleDir/bin.
This commit is contained in:
parent
d70526fa90
commit
d25c8e29d4
1 changed files with 4 additions and 0 deletions
|
|
@ -467,6 +467,10 @@ proc installFromDir(dir: string, requestedVer: VersionRange, options: Options,
|
|||
when defined(unix):
|
||||
display("Creating", "symlink: $1 -> $2" %
|
||||
[pkgDestDir / bin, binDir / cleanBin], priority = MediumPriority)
|
||||
if existsFile(binDir / cleanBin):
|
||||
display("Warning:", "Symlink already exists in $1. Replacing." % binDir,
|
||||
Warning, HighPriority)
|
||||
removeFile(binDir / cleanBin)
|
||||
createSymlink(pkgDestDir / bin, binDir / cleanBin)
|
||||
binariesInstalled.incl(cleanBin)
|
||||
elif defined(windows):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue