Skip to content

Commit

Permalink
Improve version parsing (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
ofalvai committed Sep 28, 2023
1 parent b7df552 commit 45cbb97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func findIosTargetPathComponent(target string, configuration string, cordovaVers
return target
}

majorVersion, err := strconv.Atoi(cordovaVersion[0:1])
majorVersion, err := strconv.Atoi(strings.Split(cordovaVersion, ".")[0])
if err != nil || majorVersion < 7 {
// Pre-Cordova-7 behavior: path segment is just "device" or "emulator"
return target
Expand Down
4 changes: 2 additions & 2 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ func Test_findIosTargetPathComponentDeviceRelease7(t *testing.T) {
}
}

func Test_findIosTargetPathComponentDeviceDebug7(t *testing.T) {
got := findIosTargetPathComponent("device", "debug", "7.0.0")
func Test_findIosTargetPathComponentDeviceDebug10Plus(t *testing.T) {
got := findIosTargetPathComponent("device", "debug", "99.0.0")
want := "Debug-iphoneos"
if got != want {
t.Errorf("got %q, wanted %q", got, want)
Expand Down

0 comments on commit 45cbb97

Please sign in to comment.