-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
I've had this simple program:
open TruePath
open TruePath.SystemIo
let repoRoot = AbsolutePath __SOURCE_DIRECTORY__ / ".."
let folders = [|
repoRoot / "TdLib.Api" / "Objects"
repoRoot / "TdLib.Api" / "Functions"
|]
for folder in folders do
if folder.Exists() then
printfn $"Removing folder \"{folder.Value}\"…"
folder.DeleteDirectoryRecursively()
else printfn $"Nothing to clean in \"{folder.Value}\": folder doesn't exist."And it broke because folder.Exists() doesn't check for directory existence, but only for files.
Let's have separate explicit methods ExistsFile() and ExistsDirectory() (in fact we already have the latter), and make Exists() to check the entity for existence without checking for its exact kind.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed