-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix API docs script to tolerate empty docs folder #1316
Conversation
@@ -128,10 +128,9 @@ async function prepareSphinxFolder(pkg: Pkg, args: Arguments): Promise<string> { | |||
|
|||
async function deleteExistingMarkdown(pkg: Pkg): Promise<void> { | |||
const markdownDir = pkg.outputDir("docs"); | |||
if (pkg.isLatest() || (await pathExists(markdownDir))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's necessary to check if pkg.isLatest()
- it's already covered by the pathExists
check. If the path does not exist, then there is nothing to delete, regardless of latest or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks! Tested locally and worked well. I left a suggestion to make the code simpler
Co-authored-by: Arnau Casau <47946624+arnaucasau@users.noreply.github.com>
This was getting in the way of adding the new qiskit-transpiler-service docs, since its folder is empty. This also was a problem when rerunning the script if the folder had been previously deleted without having restored the deleted files before the rerun. --------- Co-authored-by: Arnau Casau <47946624+arnaucasau@users.noreply.github.com>
This was getting in the way of adding the new qiskit-transpiler-service docs, since its folder is empty. This also was a problem when rerunning the script if the folder had been previously deleted without having restored the deleted files before the rerun. --------- Co-authored-by: Arnau Casau <47946624+arnaucasau@users.noreply.github.com>
This was getting in the way of adding the new qiskit-transpiler-service docs, since its folder is empty. This also was a problem when rerunning the script if the folder had been previously deleted without having restored the deleted files before the rerun.