summary refs log tree commit diff stats
path: root/tools
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2020-07-02 07:19:13 -0700
committerGitHub <noreply@github.com>2020-07-02 16:19:13 +0200
commitdc5a40f3f39c6ea672e6dc6aca7f8118a69dda99 (patch)
tree5565f50d66e33272624093268d0c8641c770f59e /tools
parent366b9a7e4a067cece3b1215de7fb4dffc703e88a (diff)
downloadNim-dc5a40f3f39c6ea672e6dc6aca7f8118a69dda99.tar.gz
{.deprecated: [existsFile: fileExists].} (#14735)
* {.deprecated: [existsFile: fileExists].}

* s/existsFile/fileExists/ except under deps

* workaround pending #14819

* fix test
Diffstat (limited to 'tools')
-rw-r--r--tools/cmerge.nim2
-rw-r--r--tools/kochdocs.nim6
-rw-r--r--tools/nimgrep.nim2
-rw-r--r--tools/niminst/niminst.nim8
-rw-r--r--tools/nimweb.nim8
-rw-r--r--tools/vccexe/vccvswhere.nim4
6 files changed, 15 insertions, 15 deletions
diff --git a/tools/cmerge.nim b/tools/cmerge.nim
index ae81699a6..35f2f5555 100644
--- a/tools/cmerge.nim
+++ b/tools/cmerge.nim
@@ -9,7 +9,7 @@ proc process(dir, infile: string, outfile: File,
              processed: var HashSet[string]): ProcessResult =
   if processed.containsOrIncl(infile): return prSkipIncludeDir
   let toProcess = dir / infile
-  if not existsFile(toProcess):
+  if not fileExists(toProcess):
     echo "Warning: could not process: ", toProcess
     return prAddIncludeDir
   echo "adding: ", toProcess
diff --git a/tools/kochdocs.nim b/tools/kochdocs.nim
index d0f8077ed..12d3c31a3 100644
--- a/tools/kochdocs.nim
+++ b/tools/kochdocs.nim
@@ -25,10 +25,10 @@ proc findNimImpl*(): tuple[path: string, ok: bool] =
   let nim = "nim".exe
   result.path = "bin" / nim
   result.ok = true
-  if existsFile(result.path): return
+  if fileExists(result.path): return
   for dir in split(getEnv("PATH"), PathSep):
     result.path = dir / nim
-    if existsFile(result.path): return
+    if fileExists(result.path): return
   # assume there is a symlink to the exe or something:
   return (nim, false)
 
@@ -295,7 +295,7 @@ proc buildPdfDoc*(nimArgs, destPath: string) =
       removeFile(dest)
       moveFile(dest=dest, source=pdf)
       removeFile(changeFileExt(pdf, "aux"))
-      if existsFile(changeFileExt(pdf, "toc")):
+      if fileExists(changeFileExt(pdf, "toc")):
         removeFile(changeFileExt(pdf, "toc"))
       removeFile(changeFileExt(pdf, "log"))
       removeFile(changeFileExt(pdf, "out"))
diff --git a/tools/nimgrep.nim b/tools/nimgrep.nim
index 42b192f24..e4f0e91aa 100644
--- a/tools/nimgrep.nim
+++ b/tools/nimgrep.nim
@@ -511,7 +511,7 @@ proc walker(pattern; dir: string; counter: var int, errors: var int) =
         if optFollow in options and optRecursive in options and
            path.hasRightDirectory:
           walker(pattern, path, counter, errors)
-  elif existsFile(dir):
+  elif fileExists(dir):
     processFile(pattern, dir, counter, errors)
   else:
     printError "Error: no such file or directory: " & dir
diff --git a/tools/niminst/niminst.nim b/tools/niminst/niminst.nim
index 4746f328a..88d16f48a 100644
--- a/tools/niminst/niminst.nim
+++ b/tools/niminst/niminst.nim
@@ -639,13 +639,13 @@ proc xzDist(c: var ConfigData; windowsZip=false) =
   proc processFile(destFile, src: string) =
     let dest = tmpDir / destFile
     when false: echo "Copying ", src, " to ", dest
-    if not existsFile(src):
+    if not fileExists(src):
       echo "[Warning] Source file doesn't exist: ", src
     let destDir = dest.splitFile.dir
     if not dirExists(destDir): createDir(destDir)
     copyFileWithPermissions(src, dest)
 
-  if not windowsZip and not existsFile("build" / buildBatFile):
+  if not windowsZip and not fileExists("build" / buildBatFile):
     quit("No C sources found in ./build/, please build by running " &
          "./koch csource -d:release.")
 
@@ -708,8 +708,8 @@ RunProgram="tools\downloader.exe"
 # -- prepare build files for .deb creation
 
 proc debDist(c: var ConfigData) =
-  if not existsFile(getOutputDir(c) / "build.sh"): quit("No build.sh found.")
-  if not existsFile(getOutputDir(c) / "install.sh"): quit("No install.sh found.")
+  if not fileExists(getOutputDir(c) / "build.sh"): quit("No build.sh found.")
+  if not fileExists(getOutputDir(c) / "install.sh"): quit("No install.sh found.")
 
   if c.debOpts.shortDesc == "": quit("shortDesc must be set in the .ini file.")
   if c.debOpts.licenses.len == 0:
diff --git a/tools/nimweb.nim b/tools/nimweb.nim
index a654c2b0a..0a853a54d 100644
--- a/tools/nimweb.nim
+++ b/tools/nimweb.nim
@@ -199,7 +199,7 @@ proc walkDirRecursively(s: var seq[string], root, ext: string) =
 
 proc addFiles(s: var seq[string], dir, ext: string, patterns: seq[string]) =
   for p in items(patterns):
-    if existsFile(dir / addFileExt(p, ext)):
+    if fileExists(dir / addFileExt(p, ext)):
       s.add(dir / addFileExt(p, ext))
     if existsDir(dir / p):
       walkDirRecursively(s, dir / p, ext)
@@ -273,9 +273,9 @@ proc findNim(c: TConfigData): string =
   if c.nimCompiler.len > 0: return c.nimCompiler
   var nim = "nim".exe
   result = "bin" / nim
-  if existsFile(result): return
+  if fileExists(result): return
   for dir in split(getEnv("PATH"), PathSep):
-    if existsFile(dir / nim): return dir / nim
+    if fileExists(dir / nim): return dir / nim
   # assume there is a symlink to the exe or something:
   return nim
 
@@ -351,7 +351,7 @@ proc buildPdfDoc(c: var TConfigData, destPath: string) =
       removeFile(dest)
       moveFile(dest=dest, source=pdf)
       removeFile(changeFileExt(pdf, "aux"))
-      if existsFile(changeFileExt(pdf, "toc")):
+      if fileExists(changeFileExt(pdf, "toc")):
         removeFile(changeFileExt(pdf, "toc"))
       removeFile(changeFileExt(pdf, "log"))
       removeFile(changeFileExt(pdf, "out"))
diff --git a/tools/vccexe/vccvswhere.nim b/tools/vccexe/vccvswhere.nim
index 11ad39ce9..8f62f06ca 100644
--- a/tools/vccexe/vccvswhere.nim
+++ b/tools/vccexe/vccvswhere.nim
@@ -18,7 +18,7 @@ proc vccVswhereExtractVcVarsAllPath(vswherePath: string): string =
   let vsPath = execProcess(&"\"{vswherePath}\" {vswhereArgs}").strip()
   if vsPath.len > 0:
     let vcvarsallPath = joinPath(vsPath, vcvarsRelativePath)
-    if existsFile(vcvarsallPath):
+    if fileExists(vcvarsallPath):
       return vcvarsallPath
 
 proc vccVswhereGeneratePath(envName: string): string =
@@ -41,7 +41,7 @@ proc vccVswhereVcVarsAllPath*(): string =
 
   for tryEnv in ["ProgramFiles(x86)", "ProgramFiles"]:
     let vswherePath = vccVswhereGeneratePath(tryEnv)
-    if vswherePath.len > 0 and existsFile(vswherePath):
+    if vswherePath.len > 0 and fileExists(vswherePath):
       let vcVarsAllPath = vccVswhereExtractVcVarsAllPath(vswherePath)
       if vcVarsAllPath.len > 0:
         return vcVarsAllPath