diff options
| author | sigoden <sigoden@gmail.com> | 2024-06-06 16:35:37 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-06 16:35:37 +0800 |
| commit | 6d1ad27900634bd16089eb3fe847fe9583dcf3d9 (patch) | |
| tree | 0904f5fb53394502e1b84f2a610a909c37a9102b /scripts/create.sh | |
| parent | 39447fb39e93b054fb2bb839fb774d1b6af080e7 (diff) | |
| download | llm-functions-docker-6d1ad27900634bd16089eb3fe847fe9583dcf3d9.tar.gz | |
refactor: make scripts/create.sh works on bash 3 (#28)
Diffstat (limited to 'scripts/create.sh')
| -rwxr-xr-x | scripts/create.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/create.sh b/scripts/create.sh index 3e20ac1..0d558fa 100755 --- a/scripts/create.sh +++ b/scripts/create.sh @@ -83,15 +83,15 @@ build_properties() { properties='' for param in "${argc_params[@]}"; do if [[ "$param" == *'!' ]]; then - param="${param::-1}" + param="${param:0:$((${#param}-1))}" required_params+=("$param") property='{"'"$param"'":{"type":"string","description":""}}' elif [[ "$param" == *'+' ]]; then - param="${param::-1}" + param="${param:0:$((${#param}-1))}" required_params+=("$param") property='{"'"$param"'":{"type":"array","description":"","items": {"type":"string"}}}' elif [[ "$param" == *'*' ]]; then - param="${param::-1}" + param="${param:0:$((${#param}-1))}" property='{"'"$param"'":{"type":"array","description":"","items": {"type":"string"}}}' else property='{"'"$param"'":{"type":"string","description":""}}' @@ -106,7 +106,7 @@ build_properties() { required+="\"$param\"," done if [[ -n "$required" ]]; then - required="${required::-1}" + required="${required:0:$((${#required}-1))}" required+="]" fi echo '{ |
