Skip to content

Commit

Permalink
Fixes #13.
Browse files Browse the repository at this point in the history
  • Loading branch information
dom96 committed May 17, 2017
1 parent e73293e commit 8f2c638
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/choosenim/switcher.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os, strutils, osproc, pegs

import nimblepkg/[cli, version]
import nimblepkg/[cli, version, options]

import cliparams, common

Expand Down Expand Up @@ -80,6 +80,16 @@ proc writeProxy(bin: string, params: CliParams) =

let proxyPath = params.getProxyPath(bin)

if bin == "nimble":
# Check for "lib" dir in ~/.nimble. Issue #13.
let dir = params.nimbleOptions.getNimbleDir() / "lib"
if dirExists(dir):
let msg = ("Nimble will fail because '$1' exists. Would you like me " &
"to remove it?") % dir
if prompt(dontForcePrompt, msg):
removeDir(dir)
display("Removed", dir, priority = HighPriority)

if symlinkExists(proxyPath):
let msg = "Symlink for '$1' detected in '$2'. Can I remove it?" %
[bin, proxyPath.splitFile().dir]
Expand Down

0 comments on commit 8f2c638

Please sign in to comment.