Skip to content

Commit e673a95

Browse files
authored
fix: makefile rewrite check for existing remotes (#216)
* better remote overwrite * Set Version 0.7.7
1 parent 05d12b5 commit e673a95

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name = "DocumentationGenerator"
22
uuid = "8f0d3306-d70b-5309-b898-24bb6ab47850"
33
authors = ["Sebastian Pfitzner <pfitzseb@physik.hu-berlin.de>", "Simon Danisch <sdanisch@gmail.com>", "Venkatesh Dayananda <venkatesh@juliacomputing.com>"]
44
repo = "https://github.com/JuliaDocs/DocumentationGenerator.jl.git"
5-
version = "0.7.6"
5+
version = "0.7.7"
66

77
[deps]
88
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"

src/utils/rewrite.jl

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ function fix_makefile(makefile, documenter_version = v"0.24")
4545
has_sitename = false
4646
has_linkcheck = false
4747
has_doctest = false
48+
has_root = false
49+
has_remotes = false
4850
html = documenter_version < v"0.21" ? QuoteNode(:html) : :(Documenter.HTML())
4951

5052
fixkwarg = argument -> begin
@@ -75,6 +77,14 @@ function fix_makefile(makefile, documenter_version = v"0.24")
7577
has_linkcheck = true
7678
argument.args[2] = false
7779
end
80+
if name == :root
81+
has_root = true
82+
argument.args[2] = dirname(makefile)
83+
end
84+
if name == :remotes
85+
has_remotes = true
86+
argument.args[2] = nothing
87+
end
7888
if name == :doctest
7989
has_doctest = true
8090
argument.args[2] = false
@@ -90,7 +100,6 @@ function fix_makefile(makefile, documenter_version = v"0.24")
90100
else
91101
fixkwarg(argument)
92102
end
93-
94103
push!(new_args, argument)
95104
end
96105

@@ -111,9 +120,13 @@ function fix_makefile(makefile, documenter_version = v"0.24")
111120
push!(new_args, Expr(:kw, :doctest, false))
112121
end
113122

114-
# make sure to overwrite `root`:
115-
push!(new_args,Expr(:kw, :root, dirname(makefile)))
116-
push!(new_args, Expr(:kw, :remotes, nothing))
123+
if !has_root
124+
push!(new_args,Expr(:kw, :root, dirname(makefile)))
125+
end
126+
if !has_remotes
127+
push!(new_args, Expr(:kw, :remotes, nothing))
128+
end
129+
117130
elem = Expr(:call, new_args...)
118131
end
119132

0 commit comments

Comments
 (0)