Skip to content

Commit f270a9b

Browse files
authored
Merge pull request #89 from SpotlightKid/fix/ensure-nimble-bin-dir
fix: make sure nimble bin dir exists before trying to install DLLs there
2 parents 16b2424 + cd173c7 commit f270a9b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/choosenim.nim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright (C) Dominik Picheta. All rights reserved.
22
# BSD-3-Clause License. Look at license.txt for more info.
3-
import os, strutils, algorithm
3+
import std/[os, strutils, algorithm]
44

55
import nimblepkg/[cli, version]
66
import nimblepkg/common as nimbleCommon
@@ -94,11 +94,11 @@ proc chooseVersion(version: string, params: CliParams) =
9494
removeDir(tempDir)
9595
createDir(tempDir)
9696
extract(path, tempDir)
97+
createDir(binDir)
9798
for kind, path in walkDir(tempDir, relative = true):
9899
if kind == pcFile:
99100
try:
100-
if not fileExists(binDir / path) or
101-
getLastModificationTime(binDir / path) < getLastModificationTime(tempDir / path):
101+
if not fileExists(binDir / path) or fileNewer(tempDir / path, binDir / path):
102102
moveFile(tempDir / path, binDir / path)
103103
display("Info:", "Copied '$1' to '$2'" % [path, binDir], priority = HighPriority)
104104
except:

0 commit comments

Comments
 (0)