diff --git a/.licenses/arduino-flasher-cli/go/github.com/arduino/go-paths-helper.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/arduino/go-paths-helper.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/arduino/go-windows-runas.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/arduino/go-windows-runas.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/codeclysm/extract/v4.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/codeclysm/extract/v4.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/fatih/color.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/fatih/color.dep.yml new file mode 100755 index 0000000..3c49fef --- /dev/null +++ b/.licenses/arduino-flasher-cli/go/github.com/fatih/color.dep.yml @@ -0,0 +1,35 @@ +--- +name: github.com/fatih/color +version: v1.18.0 +type: go +summary: Package color is an ANSI color package to output colorized or SGR defined + output to the standard output. +homepage: https://pkg.go.dev/github.com/fatih/color +license: mit +licenses: +- sources: LICENSE.md + text: | + The MIT License (MIT) + + Copyright (c) 2013 Fatih Arslan + + Permission is hereby granted, free of charge, to any person obtaining a copy of + this software and associated documentation files (the "Software"), to deal in + the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +- sources: README.md + text: The MIT License (MIT) - see [`LICENSE.md`](https://github.com/fatih/color/blob/master/LICENSE.md) + for more details +notices: [] diff --git a/.licenses/arduino-flasher-cli/go/github.com/h2non/filetype.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/h2non/filetype.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/h2non/filetype/matchers.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/h2non/filetype/matchers.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/h2non/filetype/matchers/isobmff.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/h2non/filetype/matchers/isobmff.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/h2non/filetype/types.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/h2non/filetype/types.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/jedib0t/go-pretty/v6/table.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/jedib0t/go-pretty/v6/table.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/jedib0t/go-pretty/v6/text.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/jedib0t/go-pretty/v6/text.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/juju/errors.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/juju/errors.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/klauspost/compress.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/klauspost/compress.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/klauspost/compress/fse.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/klauspost/compress/fse.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/klauspost/compress/huff0.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/klauspost/compress/huff0.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/klauspost/compress/internal/cpuinfo.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/klauspost/compress/internal/cpuinfo.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/klauspost/compress/internal/le.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/klauspost/compress/internal/le.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/klauspost/compress/internal/snapref.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/klauspost/compress/internal/snapref.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/klauspost/compress/zstd.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/klauspost/compress/zstd.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/klauspost/compress/zstd/internal/xxhash.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/klauspost/compress/zstd/internal/xxhash.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/mattn/go-colorable.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/mattn/go-colorable.dep.yml new file mode 100755 index 0000000..2bc368b --- /dev/null +++ b/.licenses/arduino-flasher-cli/go/github.com/mattn/go-colorable.dep.yml @@ -0,0 +1,34 @@ +--- +name: github.com/mattn/go-colorable +version: v0.1.13 +type: go +summary: +homepage: https://pkg.go.dev/github.com/mattn/go-colorable +license: mit +licenses: +- sources: LICENSE + text: | + The MIT License (MIT) + + Copyright (c) 2016 Yasuhiro Matsumoto + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +- sources: README.md + text: MIT +notices: [] diff --git a/.licenses/arduino-flasher-cli/go/github.com/mattn/go-isatty.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/mattn/go-isatty.dep.yml new file mode 100755 index 0000000..fcf3912 --- /dev/null +++ b/.licenses/arduino-flasher-cli/go/github.com/mattn/go-isatty.dep.yml @@ -0,0 +1,22 @@ +--- +name: github.com/mattn/go-isatty +version: v0.0.20 +type: go +summary: Package isatty implements interface to isatty +homepage: https://pkg.go.dev/github.com/mattn/go-isatty +license: mit +licenses: +- sources: LICENSE + text: | + Copyright (c) Yasuhiro MATSUMOTO + + MIT License (Expat) + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +- sources: README.md + text: MIT +notices: [] diff --git a/.licenses/arduino-flasher-cli/go/github.com/mattn/go-runewidth.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/mattn/go-runewidth.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/mitchellh/colorstring.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/mitchellh/colorstring.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/rivo/uniseg.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/rivo/uniseg.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/schollz/progressbar/v3.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/schollz/progressbar/v3.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/sirupsen/logrus.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/sirupsen/logrus.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/spf13/cobra.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/spf13/cobra.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/spf13/pflag.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/spf13/pflag.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/ulikunitz/xz.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/ulikunitz/xz.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/ulikunitz/xz/internal/hash.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/ulikunitz/xz/internal/hash.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/ulikunitz/xz/internal/xlog.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/ulikunitz/xz/internal/xlog.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/github.com/ulikunitz/xz/lzma.dep.yml b/.licenses/arduino-flasher-cli/go/github.com/ulikunitz/xz/lzma.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/go.bug.st/cleanup.dep.yml b/.licenses/arduino-flasher-cli/go/go.bug.st/cleanup.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/go.bug.st/f.dep.yml b/.licenses/arduino-flasher-cli/go/go.bug.st/f.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/go.bug.st/relaxed-semver.dep.yml b/.licenses/arduino-flasher-cli/go/go.bug.st/relaxed-semver.dep.yml new file mode 100755 index 0000000..36bfdcf --- /dev/null +++ b/.licenses/arduino-flasher-cli/go/go.bug.st/relaxed-semver.dep.yml @@ -0,0 +1,45 @@ +--- +name: go.bug.st/relaxed-semver +version: v0.15.0 +type: go +summary: +homepage: https://pkg.go.dev/go.bug.st/relaxed-semver +license: bsd-3-clause +licenses: +- sources: LICENSE + text: |2+ + + Copyright (c) 2018-2025, Cristian Maglie. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + 3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +notices: [] +... diff --git a/.licenses/arduino-flasher-cli/go/golang.org/x/sys/unix.dep.yml b/.licenses/arduino-flasher-cli/go/golang.org/x/sys/unix.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/golang.org/x/term.dep.yml b/.licenses/arduino-flasher-cli/go/golang.org/x/term.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/golang.org/x/text/width.dep.yml b/.licenses/arduino-flasher-cli/go/golang.org/x/text/width.dep.yml old mode 100644 new mode 100755 diff --git a/.licenses/arduino-flasher-cli/go/gopkg.in/yaml.v3.dep.yml b/.licenses/arduino-flasher-cli/go/gopkg.in/yaml.v3.dep.yml new file mode 100755 index 0000000..e77248e --- /dev/null +++ b/.licenses/arduino-flasher-cli/go/gopkg.in/yaml.v3.dep.yml @@ -0,0 +1,80 @@ +--- +name: gopkg.in/yaml.v3 +version: v3.0.1 +type: go +summary: Package yaml implements YAML support for the Go language. +homepage: https://pkg.go.dev/gopkg.in/yaml.v3 +license: other +licenses: +- sources: LICENSE + text: |2 + + This project is covered by two different licenses: MIT and Apache. + + #### MIT License #### + + The following files were ported to Go from C files of libyaml, and thus + are still covered by their original MIT license, with the additional + copyright staring in 2011 when the project was ported over: + + apic.go emitterc.go parserc.go readerc.go scannerc.go + writerc.go yamlh.go yamlprivateh.go + + Copyright (c) 2006-2010 Kirill Simonov + Copyright (c) 2006-2011 Kirill Simonov + + Permission is hereby granted, free of charge, to any person obtaining a copy of + this software and associated documentation files (the "Software"), to deal in + the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is furnished to do + so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + + ### Apache License ### + + All the remaining project files are covered by the Apache license: + + Copyright (c) 2011-2019 Canonical Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +- sources: README.md + text: |- + The yaml package is licensed under the MIT and Apache License 2.0 licenses. + Please see the LICENSE file for details. +notices: +- sources: NOTICE + text: |- + Copyright 2011-2016 Canonical Ltd. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/check_for_updates.go b/check_for_updates.go new file mode 100644 index 0000000..4c95440 --- /dev/null +++ b/check_for_updates.go @@ -0,0 +1,78 @@ +// This file is part of arduino-flasher-cli. +// +// Copyright 2025 ARDUINO SA (http://www.arduino.cc/) +// +// This software is released under the GNU General Public License version 3, +// which covers the main part of arduino-flasher-cli. +// The terms of this license can be found at: +// https://www.gnu.org/licenses/gpl-3.0.en.html +// +// You can be released from the requirements of the above licenses by purchasing +// a commercial license. Buying such a license is mandatory if you want to +// modify or otherwise use the software for commercial activities involving the +// Arduino software without disclosing the source code of your own applications. +// To purchase a commercial license, send an email to license@arduino.cc. + +package main + +import ( + "encoding/json" + "fmt" + "net/http" + "strings" + + "github.com/fatih/color" + semver "go.bug.st/relaxed-semver" + + "github.com/arduino/arduino-flasher-cli/feedback" + "github.com/arduino/arduino-flasher-cli/i18n" + "github.com/arduino/arduino-flasher-cli/updater" +) + +type FlasherRelease struct { + TagName string `json:"tag_name"` +} + +func checkForUpdates() error { + currentVersion, err := semver.Parse(Version) + if err != nil { + return err + } + + c := updater.NewClient() + req, err := http.NewRequest("GET", "https://api.github.com/repos/arduino/arduino-flasher-cli/releases/latest", nil) + if err != nil { + return err + } + resp, err := c.HTTPClient.Do(req) + if err != nil { + return err + } + defer resp.Body.Close() + + var release FlasherRelease + err = json.NewDecoder(resp.Body).Decode(&release) + if err != nil { + return err + } + + release.TagName = strings.TrimPrefix(release.TagName, "v") + latestVersion, err := semver.Parse(release.TagName) + if err != nil { + return err + } + + // Do nothing if the Arduino Flasher CLI is up to date + if currentVersion.GreaterThanOrEqual(latestVersion) { + return nil + } + + msg := fmt.Sprintf("\n\n%s %s → %s\n%s", + color.YellowString(i18n.Tr("A new release of Arduino Flasher CLI is available:")), + color.CyanString(currentVersion.String()), + color.CyanString(latestVersion.String()), + color.YellowString("https://www.arduino.cc/en/software/#flasher-tool")) + feedback.Print(msg) + + return nil +} diff --git a/go.mod b/go.mod index 1f966aa..f08eb04 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ require ( github.com/arduino/go-paths-helper v1.14.0 github.com/arduino/go-windows-runas v1.0.1 github.com/codeclysm/extract/v4 v4.0.0 + github.com/fatih/color v1.18.0 github.com/jedib0t/go-pretty/v6 v6.6.8 github.com/leonelquinteros/gotext v1.7.2 github.com/schollz/progressbar/v3 v3.18.0 @@ -14,6 +15,7 @@ require ( github.com/stretchr/testify v1.10.0 go.bug.st/cleanup v1.0.0 go.bug.st/f v0.4.0 + go.bug.st/relaxed-semver v0.15.0 ) require ( @@ -31,7 +33,6 @@ require ( github.com/dominikbraun/graph v0.23.0 // indirect github.com/elliotchance/orderedmap/v3 v3.1.0 // indirect github.com/emirpasic/gods v1.18.1 // indirect - github.com/fatih/color v1.18.0 // indirect github.com/fsnotify/fsnotify v1.9.0 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.6.2 // indirect diff --git a/go.sum b/go.sum index 386a8c9..8bf5157 100644 --- a/go.sum +++ b/go.sum @@ -171,6 +171,8 @@ go.bug.st/cleanup v1.0.0 h1:XVj1HZxkBXeq3gMT7ijWUpHyIC1j8XAoNSyQ06CskgA= go.bug.st/cleanup v1.0.0/go.mod h1:EqVmTg2IBk4znLbPD28xne3abjsJftMdqqJEjhn70bk= go.bug.st/f v0.4.0 h1:Vstqb950nMA+PhAlRxUw8QL1ntHy/gXHNyyzjkQLJ10= go.bug.st/f v0.4.0/go.mod h1:bMo23205ll7UW63KwO1ut5RdlJ9JK8RyEEr88CmOF5Y= +go.bug.st/relaxed-semver v0.15.0 h1:w37+SYQPxF53RQO7QZZuPIMaPouOifdaP0B1ktst2nA= +go.bug.st/relaxed-semver v0.15.0/go.mod h1:bwHiCtYuD2m716tBk2OnOBjelsbXw9el5EIuyxT/ksU= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= diff --git a/main.go b/main.go index 7ef5573..6e3f7da 100644 --- a/main.go +++ b/main.go @@ -60,7 +60,11 @@ func main() { Use: "version", Short: "Print the version number of Arduino Flasher CLI", Run: func(cmd *cobra.Command, args []string) { - fmt.Println("Arduino Flasher CLI v" + Version) + fmt.Println("Arduino Flasher CLI " + Version) + err := checkForUpdates() + if err != nil { + feedback.Warning("failed to check for updates: " + err.Error()) + } }, })