From da3d0bc6f0004c149aa340056a196aac655bcf7c Mon Sep 17 00:00:00 2001 From: James Carr <70200140+lesamouraipourpre@users.noreply.github.com> Date: Sat, 26 Jun 2021 19:13:54 +0100 Subject: [PATCH] Only use package_folder_prefix if there any subpackages `circuitpython-build-bundles` fails if called with no parameter for `--package_folder_prefix` This only includes the option once there is a submodule with a directory in it. --- build.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 67648d3..748ec9e 100755 --- a/build.sh +++ b/build.sh @@ -32,4 +32,10 @@ gawk -F '\n' '{ match($1, /(drivers|helpers)\/(.+)\/(.+)\:/, arr) ; if (length(a gawk '{ trimmed = substr($0, 1, length($0) - 2) ; print "\"" trimmed "\"" }' ) -circuitpython-build-bundles --filename_prefix circuitpython-org-bundle --library_location libraries --library_depth 2 --package_folder_prefix "$P" +if [ -z "$P" ]; then + P="" +else + P="--package_folder_prefix $P" +fi + +circuitpython-build-bundles --filename_prefix circuitpython-org-bundle --library_location libraries --library_depth 2 "$P"