Packaging: Added deprecation warnings when running grafana-cli or grafana-server; the grafana command should be used instead. (#66976)

* Add grafana-cli and grafana-server deprecation warnings

* remove extra :
This commit is contained in:
Kevin Minehart 2023-04-20 12:51:50 -05:00 committed by GitHub
parent 4daf53fb08
commit 405bda7e99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,8 @@ import (
"path/filepath"
"runtime"
"syscall"
"github.com/fatih/color"
)
func RunGrafanaCmd(subCmd string) int {
@ -17,6 +19,13 @@ func RunGrafanaCmd(subCmd string) int {
return 1
}
switch filepath.Base(curr) {
case "grafana-server":
fmt.Printf("%s: %s\n", color.RedString("Deprecation warning"), "The standalone 'grafana-server' program is deprecated and will be removed in the future. Please update all uses of 'grafana-server' to 'grafana server'")
case "grafana-cli":
fmt.Printf("%s: %s\n", color.RedString("Deprecation warning"), "The standalone 'grafana-cli' program is deprecated and will be removed in the future. Please update all uses of 'grafana-cli' to 'grafana cli'")
}
executable := "grafana"
if runtime.GOOS == "windows" {
executable += ".exe"