mirror of
https://github.com/Smaug123/gitea-repo-config
synced 2025-10-07 08:28:40 +00:00
18 lines
437 B
Forth
18 lines
437 B
Forth
namespace Gitea.Declarative.Test
|
|
|
|
open System.IO
|
|
|
|
[<RequireQualifiedAccess>]
|
|
module Utils =
|
|
|
|
let rec findFileAbove (fileName : string) (di : DirectoryInfo) =
|
|
if isNull di then
|
|
failwith "hit the root without finding anything"
|
|
|
|
let candidate = Path.Combine (di.FullName, fileName) |> FileInfo
|
|
|
|
if candidate.Exists then
|
|
candidate
|
|
else
|
|
findFileAbove fileName di.Parent
|