You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using antsibull-docs sphinx-init the generated build.sh is generated with a cd command into the full hardcoded directory name.
There are actually two issues with this I prefer to address:
If the path contains spaces, the script will fail because the paths are not quoted or escaped.
I would prefer the paths are not hardcoded, but relative.
For 1) we could quote or escape the path. Fixing 2) would fix 1) as well, but it can also be deceptively complicated.
One thing helping us with that maybe is the fact that the script is generated specifically to run in bash, so we don't really have to deal with all the edge cases for other shells.
FWIW, in my own uses, I replace that first line with this:
pushd "${BASH_SOURCE%/*}"
(and then I add popd to the end of the script)
We can use the above with cd as well, and optionally put a cd - at the end, though I don't think I've encountered a system where pushd/popd don't work, I think they are builtins.
At a minimum we should fix the quoting issue, not sure what the opinions are on the the relative path, but I like it for portability (I can move all the generated stuff around and have it still work).
The text was updated successfully, but these errors were encountered:
When using
antsibull-docs sphinx-init
the generatedbuild.sh
is generated with acd
command into the full hardcoded directory name.There are actually two issues with this I prefer to address:
For 1) we could quote or escape the path. Fixing 2) would fix 1) as well, but it can also be deceptively complicated.
One thing helping us with that maybe is the fact that the script is generated specifically to run in bash, so we don't really have to deal with all the edge cases for other shells.
FWIW, in my own uses, I replace that first line with this:
(and then I add
popd
to the end of the script)We can use the above with
cd
as well, and optionally put acd -
at the end, though I don't think I've encountered a system wherepushd
/popd
don't work, I think they are builtins.At a minimum we should fix the quoting issue, not sure what the opinions are on the the relative path, but I like it for portability (I can move all the generated stuff around and have it still work).
The text was updated successfully, but these errors were encountered: