diff options
author | toofar <toofar@spalge.com> | 2024-02-25 15:18:25 +1300 |
---|---|---|
committer | toofar <toofar@spalge.com> | 2024-02-25 16:30:27 +1300 |
commit | 5687177d4dd70284cce7591aa26c44898ddb4ff4 (patch) | |
tree | 31cbea558b8216f6a736d5139a8cb092cf11f453 | |
parent | b92f05335006eec526dd15a476150c6212d6ff47 (diff) | |
download | qutebrowser-5687177d4dd70284cce7591aa26c44898ddb4ff4.tar.gz qutebrowser-5687177d4dd70284cce7591aa26c44898ddb4ff4.zip |
ci: fix --debug patching on all platforms (for real?)
It seems `sed -i` is not very portable. Initially we were using this
command:
sed -i '' '/.-d., .--debug.,/s/$/ default=True,/' qutebrowser/qutebrowser.py
and then that started breaking on windows, I'm not sure why, with "can't
read /.-d., .--debug.,/s/$/ default=True,/: No such file or directory".
Then we changed to:
sed -i '/.-d., .--debug.,/s/$/ default=True,/' qutebrowser/qutebrowser.py
so without the extension argument, but that broke on mac with "1:
"qutebrowser/qutebrowser.py": extra characters at the end of q command"
then we tried:
sed -i'' '/.-d., .--debug.,/s/$/ default=True,/' qutebrowser/qutebrowser.py
and that also broke on mac with the same error. On the recommendation of
stackoverflow I just changed it no not use in-place editing and do a
good old fashioned move afterwards. https://unix.stackexchange.com/questions/92895/how-can-i-achieve-portability-with-sed-i-in-place-editing
... record scratch ...
Apparently these GHA steps are being run in powershell in windows where
`mv` is implemented by `Move-Item` where you have to use -Force to
overwrite destination files.
But that's not portable. cp does happily overwrite without any
additional instruction though. So I'm doing cp instead of mv and then
removing the temp file.
Probably if this drags out anymore we should download something off of
pypi which is platform independent to handle it.
-rw-r--r-- | .github/workflows/nightly.yml | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 400d65559..b326c2ad6 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -59,7 +59,9 @@ jobs: - name: Patch qutebrowser for debugging if: "contains(matrix.args, '--debug')" run: | - sed -i'' '/.-d., .--debug.,/s/$/ default=True,/' qutebrowser/qutebrowser.py + sed '/.-d., .--debug.,/s/$/ default=True,/' qutebrowser/qutebrowser.py > qutebrowser/qutebrowser.py.tmp + cp qutebrowser/qutebrowser.py.tmp qutebrowser/qutebrowser.py + rm qutebrowser/qutebrowser.py.tmp - name: Run tox run: "tox -e ${{ matrix.toxenv }} -- --gh-token ${{ secrets.GITHUB_TOKEN }} ${{ matrix.args }}" - name: Gather info |