Skip to content

Commit

Permalink
Misc fixes (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
laenas authored Mar 10, 2021
1 parent 827f77c commit aaaf95b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion samples/generators/index.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ let generate' (ctx : SiteContents) (_: string) =
|> List.map (fun p -> span [] [!! p.link] )

let siteModel = ctx.TryGetValue<Customloader.CustomConfig> ()
let gv = siteModel |> Option.map (fun s -> s.SomeGlobalValue) |> Option.defaultValue "NO DEAFULT"
let gv = siteModel |> Option.map (fun s -> s.SomeGlobalValue) |> Option.defaultValue "NO DEFAULT"

html [] [
div [] psts
Expand Down
2 changes: 1 addition & 1 deletion samples/generators/post.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ let generate' (ctx : SiteContents) (page: string) =
|> List.map (fun p -> span [] [!! p.link] )

let siteModel = ctx.TryGetValue<Customloader.CustomConfig> ()
let gv = siteModel |> Option.map (fun s -> s.SomeGlobalValue) |> Option.defaultValue "NO DEAFULT"
let gv = siteModel |> Option.map (fun s -> s.SomeGlobalValue) |> Option.defaultValue "NO DEFAULT"

html [] [
div [] [
Expand Down
5 changes: 2 additions & 3 deletions src/Fornax/Generator.fs
Original file line number Diff line number Diff line change
Expand Up @@ -458,13 +458,13 @@ let generateFolder (projectRoot : string) (isWatch: bool) =
if File.Exists configPath then
match ConfigEvaluator.evaluate fsi sc configPath with
| Ok cfg -> Some cfg
| _ -> None
| Error error -> raise (FornaxGeneratorException error)
else
None

match config with
| None ->
raise (FornaxGeneratorException "Couldn't find or load config")
raise (FornaxGeneratorException "Couldn't find config.fsx")
| Some config ->
let loaders = Directory.GetFiles(Path.Combine(projectRoot, "loaders"), "*.fsx")
let sc =
Expand All @@ -478,7 +478,6 @@ let generateFolder (projectRoot : string) (isWatch: bool) =
state)
sc.Errors() |> List.iter (fun er -> printfn "BAD FILE: %s" er.Path)


let logResult (result : GeneratorResult) =
match result with
| GeneratorIgnored -> ()
Expand Down

0 comments on commit aaaf95b

Please sign in to comment.