summary refs log tree commit diff stats
path: root/tools
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2020-07-03 14:04:23 -0700
committerGitHub <noreply@github.com>2020-07-03 23:04:23 +0200
commit695154970d839add2fbbe9754e9e638511120729 (patch)
tree48b43613261cb982b7e408c96a7cf6688526dd68 /tools
parent4f6acf24ffde4c43ea9f8c954265d23312453b31 (diff)
downloadNim-695154970d839add2fbbe9754e9e638511120729.tar.gz
deprecate existsDir; use dirExists instead (#14884)
Diffstat (limited to 'tools')
-rw-r--r--tools/nimgrep.nim2
-rw-r--r--tools/niminst/niminst.nim8
-rw-r--r--tools/nimweb.nim4
3 files changed, 7 insertions, 7 deletions
diff --git a/tools/nimgrep.nim b/tools/nimgrep.nim
index e4f0e91aa..138f1680c 100644
--- a/tools/nimgrep.nim
+++ b/tools/nimgrep.nim
@@ -495,7 +495,7 @@ proc styleInsensitive(s: string): string =
     else: addx()
 
 proc walker(pattern; dir: string; counter: var int, errors: var int) =
-  if existsDir(dir):
+  if dirExists(dir):
     for kind, path in walkDir(dir):
       case kind
       of pcFile:
diff --git a/tools/niminst/niminst.nim b/tools/niminst/niminst.nim
index 88d16f48a..a5fc388cd 100644
--- a/tools/niminst/niminst.nim
+++ b/tools/niminst/niminst.nim
@@ -251,12 +251,12 @@ proc walkDirRecursively(s: var seq[string], root, explicit: string,
 
 proc addFiles(s: var seq[string], patterns: seq[string]) =
   for p in items(patterns):
-    if existsDir(p):
+    if dirExists(p):
       walkDirRecursively(s, p, p, false)
     else:
       var i = 0
       for f in walkPattern(p):
-        if existsDir(f):
+        if dirExists(f):
           walkDirRecursively(s, f, p, false)
         elif not ignoreFile(f, p, false):
           add(s, unixToNativePath(f))
@@ -518,7 +518,7 @@ template gatherFiles(fun, libpath, outDir) =
 
 proc srcdist(c: var ConfigData) =
   let cCodeDir = getOutputDir(c) / "c_code"
-  if not existsDir(cCodeDir): createDir(cCodeDir)
+  if not dirExists(cCodeDir): createDir(cCodeDir)
   gatherFiles(copyFile, c.libpath, cCodeDir)
   var winIndex = -1
   var intel32Index = -1
@@ -532,7 +532,7 @@ proc srcdist(c: var ConfigData) =
       if cpuname.cmpIgnoreStyle("i386") == 0: intel32Index = cpuA
       elif cpuname.cmpIgnoreStyle("amd64") == 0: intel64Index = cpuA
       var dir = getOutputDir(c) / buildDir(osA, cpuA)
-      if existsDir(dir): removeDir(dir)
+      if dirExists(dir): removeDir(dir)
       createDir(dir)
       var cmd = ("nim compile -f --symbolfiles:off --compileonly " &
                  "--gen_mapping --cc:gcc --skipUserCfg" &
diff --git a/tools/nimweb.nim b/tools/nimweb.nim
index 0a853a54d..10319be87 100644
--- a/tools/nimweb.nim
+++ b/tools/nimweb.nim
@@ -201,7 +201,7 @@ proc addFiles(s: var seq[string], dir, ext: string, patterns: seq[string]) =
   for p in items(patterns):
     if fileExists(dir / addFileExt(p, ext)):
       s.add(dir / addFileExt(p, ext))
-    if existsDir(dir / p):
+    if dirExists(dir / p):
       walkDirRecursively(s, dir / p, ext)
 
 proc parseIniFile(c: var TConfigData) =
@@ -483,7 +483,7 @@ proc buildPage(c: var TConfigData, file, title, rss: string, assetDir = "") =
     quit("[Error] cannot open: " & temp)
   var f: File
   var outfile = c.webUploadOutput / "$#.html" % file
-  if not existsDir(outfile.splitFile.dir):
+  if not dirExists(outfile.splitFile.dir):
     createDir(outfile.splitFile.dir)
   if open(f, outfile, fmWrite):
     writeLine(f, generateHTMLPage(c, file, title, content, rss, assetDir))