File tree Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -40,8 +40,15 @@ MultiDocumenter.make(
40
40
41
41
gitroot = normpath (joinpath (@__DIR__ , " .." ))
42
42
run (` git pull` )
43
- # we expect gh-pages to already be set up
44
- run (` git checkout gh-pages` )
43
+ outbranch = " gh-pages"
44
+ has_outbranch = true
45
+ if ! success (` git checkout $outbranch ` )
46
+ has_outbranch = false
47
+ if ! success (` git switch --orphan $outbranch ` )
48
+ @error " Cannot create new orphaned branch $outbranch ."
49
+ exit (1 )
50
+ end
51
+ end
45
52
for file in readdir (gitroot; join = true )
46
53
endswith (file, " .git" ) && continue
47
54
rm (file; force = true , recursive = true )
@@ -50,6 +57,14 @@ for file in readdir(outpath)
50
57
cp (joinpath (outpath, file), joinpath (gitroot, file))
51
58
end
52
59
run (` git add .` )
53
- run (` git commit -m 'Aggregate documentation'` )
54
- run (` git push` )
55
- run (` git checkout main` )
60
+ if success (` git commit -m 'Aggregate documentation'` )
61
+ @info " Pushing updated documentation."
62
+ if has_outbranch
63
+ run (` git push` )
64
+ else
65
+ run (` git push -u origin $outbranch ` )
66
+ end
67
+ run (` git checkout main` )
68
+ else
69
+ @info " No changes to aggregated documentation."
70
+ end
You can’t perform that action at this time.
0 commit comments