Skip to content

Commit d81e6aa

Browse files
committed
fix build process
.. and use a simpler(?) way to invoke sed I don't know why this apparently only started recently, but circuitpython-build-tools creates build_deps/circuitpython with a directory 'nvm.toml' inside. The existing sed command would attempt to run on this directory. `find pattern... -exec command... +` takes the matching items and puts them on the command... commandline, without any concerns about whitespace or quoting. `for $(find...)` has several concerns about whitespace and quoting. It also adds "-type f" to restrict the match to only files, not directories.
1 parent c98cff8 commit d81e6aa

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

.github/workflows/build.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ jobs:
7070
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
7171
run: |
7272
pip install --upgrade build twine
73-
for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do
74-
sed -i -e "s/0.0.0+auto.0/1.2.3/" $file;
75-
done;
73+
find -type f -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) -exec sed -i -e "s/0.0.0+auto.0/1.2.3/" {} +
7674
python -m build
7775
twine check dist/*

.github/workflows/release.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ jobs:
8181
TWINE_USERNAME: ${{ secrets.pypi_username }}
8282
TWINE_PASSWORD: ${{ secrets.pypi_password }}
8383
run: |
84-
for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do
85-
sed -i -e "s/0.0.0+auto.0/${{github.event.release.tag_name}}/" $file;
86-
done;
84+
find -type f -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) -exec sed -i -e "s/0.0.0+auto.0/${{github.event.release.tag_name}}/" {} +
8785
python -m build
8886
twine upload dist/*

0 commit comments

Comments
 (0)