Skip to content

Commit a035865

Browse files
committed
Merge remote-tracking branch 'origin/main' into download-grpc
2 parents 5f43be3 + c9b43b2 commit a035865

File tree

5 files changed

+94
-92
lines changed

5 files changed

+94
-92
lines changed

cmd/arduino-flasher-cli/flash/flash.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424

2525
"github.com/arduino/go-paths-helper"
2626
runas "github.com/arduino/go-windows-runas"
27+
"github.com/fatih/color"
2728
"github.com/spf13/cobra"
2829

2930
"github.com/arduino/arduino-flasher-cli/cmd/feedback"
@@ -98,7 +99,7 @@ func runFlashCommand(ctx context.Context, args []string, forceYes bool, preserve
9899
}
99100

100101
if !forceYes && !preserveUser {
101-
feedback.Print("\nWARNING: flashing a new Linux image on the board will erase any existing data you have on it.")
102+
feedback.Print(color.RedString("\nWARNING: flashing a new Linux image will erase any existing data that you have on the board.\n"))
102103
feedback.Printf("Do you want to proceed and flash %s on the board? (yes/no)", args[0])
103104

104105
var yesInput string
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" ?>
2-
<data>
3-
<read SECTOR_SIZE_IN_BYTES="512" filename="dump.bin" physical_partition_number="0" num_partition_sectors="20" start_sector="1"/>
4-
</data>
1+
<?xml version="1.0" ?>
2+
<data>
3+
<read SECTOR_SIZE_IN_BYTES="512" filename="dump.bin" physical_partition_number="0" num_partition_sectors="20" start_sector="1"/>
4+
</data>

internal/updater/flasher.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"strings"
2525

2626
"github.com/arduino/go-paths-helper"
27+
"github.com/fatih/color"
2728
"github.com/shirou/gopsutil/v4/disk"
2829

2930
"github.com/arduino/arduino-flasher-cli/cmd/feedback"
@@ -140,8 +141,8 @@ func FlashBoard(ctx context.Context, downloadedImagePath string, version string,
140141
if errT != nil {
141142
warnStr = errT.Error()
142143
}
143-
feedback.Printf("\nWARNING: %s.", warnStr)
144-
feedback.Printf("Do you want to proceed and flash %s on the board, erasing any existing data you have on it? (yes/no)", target)
144+
feedback.Print(color.RedString("\nWARNING: %s. It will not be possible to preserve your data.\n", warnStr))
145+
feedback.Printf("Do you want to proceed and flash %s on the board? (yes/no)", target)
145146

146147
var yesInput string
147148
_, err := fmt.Scanf("%s\n", &yesInput)

license_header.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ You can be released from the requirements of the above licenses by purchasing
1111
a commercial license. Buying such a license is mandatory if you want to
1212
modify or otherwise use the software for commercial activities involving the
1313
Arduino software without disclosing the source code of your own applications.
14-
To purchase a commercial license, send an email to license@arduino.cc.
14+
To purchase a commercial license, send an email to license@arduino.cc.
Lines changed: 84 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,84 @@
1-
// This file is part of arduino-flasher-cli.
2-
//
3-
// Copyright 2025 ARDUINO SA (http://www.arduino.cc/)
4-
//
5-
// This software is released under the GNU General Public License version 3,
6-
// which covers the main part of arduino-flasher-cli.
7-
// The terms of this license can be found at:
8-
// https://www.gnu.org/licenses/gpl-3.0.en.html
9-
//
10-
// You can be released from the requirements of the above licenses by purchasing
11-
// a commercial license. Buying such a license is mandatory if you want to
12-
// modify or otherwise use the software for commercial activities involving the
13-
// Arduino software without disclosing the source code of your own applications.
14-
// To purchase a commercial license, send an email to license@arduino.cc.
15-
16-
syntax = "proto3";
17-
18-
package cc.arduino.flasher.v1;
19-
20-
import "cc/arduino/flasher/v1/common.proto";
21-
22-
option go_package = "github.com/arduino/arduino-flasher-cli/rpc/cc/arduino/flasher/v1;flasher";
23-
24-
service Flasher {
25-
rpc List(ListRequest) returns (ListResponse) {};
26-
rpc Download(DownloadRequest) returns (stream DownloadResponse);
27-
rpc Flash(FlashRequest) returns (stream FlashResponse);
28-
}
29-
30-
message ListRequest {}
31-
32-
message ListResponse {
33-
repeated Release releases = 1;
34-
}
35-
36-
message Release {
37-
string build_id = 1;
38-
bool latest = 2;
39-
}
40-
41-
message DownloadRequest {
42-
// The version of the Debian image to download.
43-
// Use "latest" to download the latest.
44-
string version = 1;
45-
// The path in which the image will be downloaded.
46-
string download_path = 2;
47-
}
48-
49-
message DownloadResponse {
50-
message Result {
51-
// Empty message, reserved for future expansion.
52-
}
53-
oneof message {
54-
// Progress of the download.
55-
DownloadProgress progress = 1;
56-
// Download result.
57-
Result result = 2;
58-
}
59-
}
60-
61-
message FlashRequest {
62-
// The version of the Debian image to download.
63-
string version = 1;
64-
// The path in which the image will be downloaded and extracted.
65-
string temp_path = 2;
66-
// Preserve user partition if possible.
67-
bool preserve_user = 3;
68-
}
69-
70-
message FlashResponse {
71-
message Result {
72-
// Empty message, reserved for future expansion.
73-
}
74-
oneof message {
75-
// Progress of the download.
76-
DownloadProgress download_progress = 1;
77-
// Progress of the extraction.
78-
TaskProgress extraction_progress = 2;
79-
// Progress of qdl flashing.
80-
TaskProgress flash_progress = 3;
81-
// Flashing result.
82-
Result result = 4;
83-
}
84-
}
1+
// This file is part of arduino-flasher-cli.
2+
//
3+
// Copyright 2025 ARDUINO SA (http://www.arduino.cc/)
4+
//
5+
// This software is released under the GNU General Public License version 3,
6+
// which covers the main part of arduino-flasher-cli.
7+
// The terms of this license can be found at:
8+
// https://www.gnu.org/licenses/gpl-3.0.en.html
9+
//
10+
// You can be released from the requirements of the above licenses by purchasing
11+
// a commercial license. Buying such a license is mandatory if you want to
12+
// modify or otherwise use the software for commercial activities involving the
13+
// Arduino software without disclosing the source code of your own applications.
14+
// To purchase a commercial license, send an email to license@arduino.cc.
15+
16+
syntax = "proto3";
17+
18+
package cc.arduino.flasher.v1;
19+
20+
import "cc/arduino/flasher/v1/common.proto";
21+
22+
option go_package = "github.com/arduino/arduino-flasher-cli/rpc/cc/arduino/flasher/v1;flasher";
23+
24+
service Flasher {
25+
rpc List(ListRequest) returns (ListResponse) {};
26+
rpc Download(DownloadRequest) returns (stream DownloadResponse);
27+
rpc Flash(FlashRequest) returns (stream FlashResponse);
28+
}
29+
30+
message ListRequest {}
31+
32+
message ListResponse {
33+
repeated Release releases = 1;
34+
}
35+
36+
message Release {
37+
string build_id = 1;
38+
bool latest = 2;
39+
}
40+
41+
message DownloadRequest {
42+
// The version of the Debian image to download.
43+
// Use "latest" to download the latest.
44+
string version = 1;
45+
// The path in which the image will be downloaded.
46+
string download_path = 2;
47+
}
48+
49+
message DownloadResponse {
50+
message Result {
51+
// Empty message, reserved for future expansion.
52+
}
53+
oneof message {
54+
// Progress of the download.
55+
DownloadProgress progress = 1;
56+
// Download result.
57+
Result result = 2;
58+
}
59+
}
60+
61+
message FlashRequest {
62+
// The version of the Debian image to download.
63+
string version = 1;
64+
// The path in which the image will be downloaded and extracted.
65+
string temp_path = 2;
66+
// Preserve user partition if possible.
67+
bool preserve_user = 3;
68+
}
69+
70+
message FlashResponse {
71+
message Result {
72+
// Empty message, reserved for future expansion.
73+
}
74+
oneof message {
75+
// Progress of the download.
76+
DownloadProgress download_progress = 1;
77+
// Progress of the extraction.
78+
TaskProgress extraction_progress = 2;
79+
// Progress of qdl flashing.
80+
TaskProgress flash_progress = 3;
81+
// Flashing result.
82+
Result result = 4;
83+
}
84+
}

0 commit comments

Comments
 (0)