refactor: make scripts/create.sh works on bash 3 (#28)
This commit is contained in:
+4
-4
@@ -83,15 +83,15 @@ build_properties() {
|
|||||||
properties=''
|
properties=''
|
||||||
for param in "${argc_params[@]}"; do
|
for param in "${argc_params[@]}"; do
|
||||||
if [[ "$param" == *'!' ]]; then
|
if [[ "$param" == *'!' ]]; then
|
||||||
param="${param::-1}"
|
param="${param:0:$((${#param}-1))}"
|
||||||
required_params+=("$param")
|
required_params+=("$param")
|
||||||
property='{"'"$param"'":{"type":"string","description":""}}'
|
property='{"'"$param"'":{"type":"string","description":""}}'
|
||||||
elif [[ "$param" == *'+' ]]; then
|
elif [[ "$param" == *'+' ]]; then
|
||||||
param="${param::-1}"
|
param="${param:0:$((${#param}-1))}"
|
||||||
required_params+=("$param")
|
required_params+=("$param")
|
||||||
property='{"'"$param"'":{"type":"array","description":"","items": {"type":"string"}}}'
|
property='{"'"$param"'":{"type":"array","description":"","items": {"type":"string"}}}'
|
||||||
elif [[ "$param" == *'*' ]]; then
|
elif [[ "$param" == *'*' ]]; then
|
||||||
param="${param::-1}"
|
param="${param:0:$((${#param}-1))}"
|
||||||
property='{"'"$param"'":{"type":"array","description":"","items": {"type":"string"}}}'
|
property='{"'"$param"'":{"type":"array","description":"","items": {"type":"string"}}}'
|
||||||
else
|
else
|
||||||
property='{"'"$param"'":{"type":"string","description":""}}'
|
property='{"'"$param"'":{"type":"string","description":""}}'
|
||||||
@@ -106,7 +106,7 @@ build_properties() {
|
|||||||
required+="\"$param\","
|
required+="\"$param\","
|
||||||
done
|
done
|
||||||
if [[ -n "$required" ]]; then
|
if [[ -n "$required" ]]; then
|
||||||
required="${required::-1}"
|
required="${required:0:$((${#required}-1))}"
|
||||||
required+="]"
|
required+="]"
|
||||||
fi
|
fi
|
||||||
echo '{
|
echo '{
|
||||||
|
|||||||
Reference in New Issue
Block a user