PromptingTools.jl
PromptingTools.jl copied to clipboard
Update to DocumenterVitepress v0.2.x
This will also need the symlink folders on gh-pages to be purged. Here's a function that will do that for you:
function remove_symlinks_from_gh_pages(repo_url::String; branch::String = "gh-pages")
function success_or_error(cmd, msg = "Error running command `$(cmd)`")
out = IOBuffer()
err = IOBuffer()
result = run(pipeline(cmd; stdout = out, stderr = err))
if result.exitcode != 0
message = message * "\n\nStdout: $(String(take!(out)))" * "\n\nStderr: $(String(take!(err)))"
error(message)
end
end
# Clone the repo and switch to `gh-pages`
mktempdir() do dir
success_or_error(
`git clone --branch $(branch) --single-branch --depth 1 $repo_url $dir`,
"Failed to clone the repository at $(repo_url). Please check the repository URL and try again."
)
symlinks = filter(islink, readdir(dir; join = true))
isempty(symlinks) && return
@info "Removing symlinks" symlinks
foreach(rm, symlinks)
cd(dir) do
success_or_error(
`git stage -A`,
"Failed to stage the changes. Please check the repository and try again."
)
success_or_error(
`git commit -m "Remove symlinks from gh-pages"`,
"Failed to commit the changes. Please check the repository and try again."
)
success_or_error(
`git push origin $(branch)`,
"Failed to push the changes. Please check the repository and try again."
)
end
end
end
wow! thank you so much!! I'll review and merge over the weekend :-)
No worries! Actually, might want to hold off on that. We will have one more major change (hopefully not breaking) over the weekend I think...could do the change now but it would be better (and more extensible) to do it after that.