Skip to content

Commit 3d5b430

Browse files
authored
[skip changelog] Fix lib install crash on nightlies (#1479)
1 parent 0a6a83c commit 3d5b430

File tree

3 files changed

+25
-23
lines changed

3 files changed

+25
-23
lines changed

Diff for: cli/lib/install.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import (
3131
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
3232
"github.com/arduino/go-paths-helper"
3333
"github.com/spf13/cobra"
34+
semver "go.bug.st/relaxed-semver"
3435
)
3536

3637
func initInstallCommand() *cobra.Command {
@@ -64,7 +65,8 @@ func runInstallCommand(cmd *cobra.Command, args []string) {
6465
if installFlags.zipPath || installFlags.gitURL {
6566
if !configuration.Settings.GetBool("library.enable_unsafe_install") {
6667
documentationURL := "https://arduino.github.io/arduino-cli/latest/configuration/#configuration-keys"
67-
if !strings.Contains(globals.VersionInfo.VersionString, "git") {
68+
_, err := semver.Parse(globals.VersionInfo.VersionString)
69+
if err == nil {
6870
split := strings.Split(globals.VersionInfo.VersionString, ".")
6971
documentationURL = fmt.Sprintf("https://arduino.github.io/arduino-cli/%s.%s/configuration/#configuration-keys", split[0], split[1])
7072
}

Diff for: i18n/data/en.po

+15-15
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ msgstr "(hidden)"
8383
msgid "(legacy)"
8484
msgstr "(legacy)"
8585

86-
#: cli/lib/install.go:71
86+
#: cli/lib/install.go:73
8787
msgid "--git-url and --zip-path are disabled by default, for more information see: %v"
8888
msgstr "--git-url and --zip-path are disabled by default, for more information see: %v"
8989

90-
#: cli/lib/install.go:74
90+
#: cli/lib/install.go:76
9191
msgid "--git-url and --zip-path flags allow installing untrusted files, use it at your own risk."
9292
msgstr "--git-url and --zip-path flags allow installing untrusted files, use it at your own risk."
9393

@@ -186,7 +186,7 @@ msgid "Arduino core operations."
186186
msgstr "Arduino core operations."
187187

188188
#: cli/lib/check_deps.go:50
189-
#: cli/lib/install.go:117
189+
#: cli/lib/install.go:119
190190
msgid "Arguments error: %v"
191191
msgstr "Arguments error: %v"
192192

@@ -453,7 +453,7 @@ msgid "Couldn't determine program size"
453453
msgstr "Couldn't determine program size"
454454

455455
#: cli/arguments/sketch.go:36
456-
#: cli/lib/install.go:97
456+
#: cli/lib/install.go:99
457457
msgid "Couldn't get current working directory: %v"
458458
msgstr "Couldn't get current working directory: %v"
459459

@@ -553,7 +553,7 @@ msgstr "Disconnected"
553553
msgid "Display only the provided gRPC calls"
554554
msgstr "Display only the provided gRPC calls"
555555

556-
#: cli/lib/install.go:49
556+
#: cli/lib/install.go:50
557557
msgid "Do not install dependencies."
558558
msgstr "Do not install dependencies."
559559

@@ -594,11 +594,11 @@ msgstr "Downloads one or more libraries without installing them."
594594
msgid "Enable debug logging of gRPC calls"
595595
msgstr "Enable debug logging of gRPC calls"
596596

597-
#: cli/lib/install.go:51
597+
#: cli/lib/install.go:52
598598
msgid "Enter a path to zip file"
599599
msgstr "Enter a path to zip file"
600600

601-
#: cli/lib/install.go:50
601+
#: cli/lib/install.go:51
602602
msgid "Enter git url for libraries hosted on repositories"
603603
msgstr "Enter git url for libraries hosted on repositories"
604604

@@ -789,15 +789,15 @@ msgstr "Error in FQBN: %s"
789789
msgid "Error initializing instance: %v"
790790
msgstr "Error initializing instance: %v"
791791

792-
#: cli/lib/install.go:130
792+
#: cli/lib/install.go:132
793793
msgid "Error installing %s: %v"
794794
msgstr "Error installing %s: %v"
795795

796-
#: cli/lib/install.go:108
796+
#: cli/lib/install.go:110
797797
msgid "Error installing Git Library: %v"
798798
msgstr "Error installing Git Library: %v"
799799

800-
#: cli/lib/install.go:85
800+
#: cli/lib/install.go:87
801801
msgid "Error installing Zip Library: %v"
802802
msgstr "Error installing Zip Library: %v"
803803

@@ -1183,8 +1183,8 @@ msgstr "Installing platform %s"
11831183
msgid "Installs one or more cores and corresponding tool dependencies."
11841184
msgstr "Installs one or more cores and corresponding tool dependencies."
11851185

1186-
#: cli/lib/install.go:39
11871186
#: cli/lib/install.go:40
1187+
#: cli/lib/install.go:41
11881188
msgid "Installs one or more specified libraries into the system."
11891189
msgstr "Installs one or more specified libraries into the system."
11901190

@@ -1295,7 +1295,7 @@ msgid "LIBNAME"
12951295
msgstr "LIBNAME"
12961296

12971297
#: cli/lib/check_deps.go:34
1298-
#: cli/lib/install.go:38
1298+
#: cli/lib/install.go:39
12991299
msgid "LIBRARY"
13001300
msgstr "LIBRARY"
13011301

@@ -2285,7 +2285,7 @@ msgid "VERSION"
22852285
msgstr "VERSION"
22862286

22872287
#: cli/lib/check_deps.go:34
2288-
#: cli/lib/install.go:38
2288+
#: cli/lib/install.go:39
22892289
msgid "VERSION_NUMBER"
22902290
msgstr "VERSION_NUMBER"
22912291

@@ -2650,12 +2650,12 @@ msgstr "for a specific version."
26502650

26512651
#: cli/lib/check_deps.go:38
26522652
#: cli/lib/download.go:38
2653-
#: cli/lib/install.go:42
2653+
#: cli/lib/install.go:43
26542654
msgid "for the latest version."
26552655
msgstr "for the latest version."
26562656

26572657
#: cli/lib/check_deps.go:39
2658-
#: cli/lib/install.go:43
2658+
#: cli/lib/install.go:44
26592659
msgid "for the specific version."
26602660
msgstr "for the specific version."
26612661

Diff for: i18n/rice-box.go

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)