From d16dd491d55d55833e4a586a9a58d978221ccb3d Mon Sep 17 00:00:00 2001 From: dinosaursrarr Date: Tue, 30 Apr 2024 22:28:20 +0100 Subject: [PATCH] Handle background push without installation ID 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) }