Skip to content

Commit

Permalink
Add code to make.jl so it can run as a script
Browse files Browse the repository at this point in the history
  • Loading branch information
goerz committed Feb 13, 2024
1 parent 5306737 commit 95f6889
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Generator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ function make(pkgname; format = :html)

sitename = format !== :markdown ? "\n sitename = \"$(pkgname)\"," : ""
"""
if abspath(PROGRAM_FILE) == @__FILE__
# When running the `make.jl` file as a script, automatically activate the
# `docs` environment and dev-install the main package into that environment
import Pkg
Pkg.activate(@__DIR__)
Pkg.develop(path=joinpath(@__DIR__, ".."))
Pkg.instantiate()
end
using Documenter$(fmtpkg)
using $(pkgname)
Expand Down

0 comments on commit 95f6889

Please sign in to comment.