Get rid of annoying deprecation warnings (#164)

* Get rid of annoying deprecation warnings

Changed existsFile to fileExists and existsDir to dirExists.

* Install packages during nimble develop
This commit is contained in:
Constantine Molchanov 2020-11-25 14:28:12 +04:00 • committed by GitHub
commit 24a037ad19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -16,5 +16,5 @@ before_script:
- set -e - set -e
- export PATH=$(pwd)/nim/bin:$(pwd):$PATH - export PATH=$(pwd)/nim/bin:$(pwd):$PATH
script: script:
- nimble develop - nimble develop -y
- nim c -r tests/tester.nim - nim c -r tests/tester.nim

View file

@ -33,7 +33,7 @@ proc sendStaticIfExists(
result = Http200 result = Http200
let mimes = newMimetypes() let mimes = newMimetypes()
for p in paths: for p in paths:
if existsFile(p): if fileExists(p):
var fp = getFilePermissions(p) var fp = getFilePermissions(p)
if not fp.contains(fpOthersRead): if not fp.contains(fpOthersRead):
@ -107,7 +107,7 @@ proc handleFileRequest(
let pathDir = path.splitFile.dir / "" let pathDir = path.splitFile.dir / ""
if pathDir.startsWith(publicUrl): if pathDir.startsWith(publicUrl):
if existsDir(path): if dirExists(path):
status = await sendStaticIfExists( status = await sendStaticIfExists(
req, req,
@[path / "index.html", path / "index.htm"] @[path / "index.html", path / "index.htm"]