From 5439bb88ec8ed2473c82f20a646d9376c2727aff Mon Sep 17 00:00:00 2001 From: Tom Curtis <105217023+dinosaursrarr@users.noreply.github.com> Date: Thu, 2 May 2024 20:26:50 +0100 Subject: [PATCH] Handle background push without installation ID (#1066) Addressed https://github.com/tidbyt/pixlet/issues/1003. Someone got confused enough to write in (and I don't blame them). Seems more user friendly to point out the problem than to silently do nothing. --- cmd/push.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/push.go b/cmd/push.go index 50ca5fe9d3..3934e8fc7c 100644 --- a/cmd/push.go +++ b/cmd/push.go @@ -55,6 +55,10 @@ func push(cmd *cobra.Command, args []string) error { installationID = args[2] } + if background && len(installationID) == 0 { + return fmt.Errorf("Background push won't do anything unless you also specify an installation ID") + } + if apiToken == "" { apiToken = os.Getenv(APITokenEnv) }