1 |
>>>>> On Mon, 7 Dec 2015, Jason Zaman wrote: |
2 |
|
3 |
> Can we also have get_version_component_count() in there? |
4 |
|
5 |
> I have a package that likes to change the number of parts so I need |
6 |
> to know how many parts before I can split it up. |
7 |
|
8 |
> Basically this: |
9 |
> if [[ $(get_version_component_count) -eq 6 ]]; then |
10 |
> STUDIO_V=$(get_version_component_range 1-4) |
11 |
> BUILD_V=$(get_version_component_range 5-6) |
12 |
> else |
13 |
> STUDIO_V=$(get_version_component_range 1-3) |
14 |
> BUILD_V=$(get_version_component_range 4-5) |
15 |
> fi |
16 |
|
17 |
You could use a condition like: |
18 |
|
19 |
if [[ -n $(version_cut 6) ]]; then |
20 |
|
21 |
This assumes that the function would simply return an empty string |
22 |
when trying to read after the last component. |
23 |
|
24 |
Ulrich |