From f9e5b869da673c5d05f7eb06f871c54ac9b204b8 Mon Sep 17 00:00:00 2001 From: Rishi Jat Date: Sat, 28 Feb 2026 14:39:17 +0530 Subject: [PATCH] refactor: use cmd.Context() in RunE functions Signed-off-by: Rishi Jat --- cmd/attach.go | 2 +- cmd/build.go | 2 +- cmd/extract.go | 2 +- cmd/fetch.go | 2 +- cmd/inspect.go | 2 +- cmd/list.go | 2 +- cmd/logout.go | 2 +- cmd/modelfile/generate.go | 2 +- cmd/prune.go | 2 +- cmd/pull.go | 2 +- cmd/push.go | 2 +- cmd/rm.go | 2 +- cmd/tag.go | 2 +- cmd/upload.go | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cmd/attach.go b/cmd/attach.go index 55c390e7..e1510152 100644 --- a/cmd/attach.go +++ b/cmd/attach.go @@ -42,7 +42,7 @@ var attachCmd = &cobra.Command{ return err } - return runAttach(context.Background(), args[0]) + return runAttach(cmd.Context(), args[0]) }, } diff --git a/cmd/build.go b/cmd/build.go index 62f655c4..6fab1d55 100644 --- a/cmd/build.go +++ b/cmd/build.go @@ -42,7 +42,7 @@ var buildCmd = &cobra.Command{ return err } - return runBuild(context.Background(), args[0]) + return runBuild(cmd.Context(), args[0]) }, } diff --git a/cmd/extract.go b/cmd/extract.go index 45f60398..2545eb72 100644 --- a/cmd/extract.go +++ b/cmd/extract.go @@ -42,7 +42,7 @@ var extractCmd = &cobra.Command{ return err } - return runExtract(context.Background(), args[0]) + return runExtract(cmd.Context(), args[0]) }, } diff --git a/cmd/fetch.go b/cmd/fetch.go index c7c44aca..a815d04b 100644 --- a/cmd/fetch.go +++ b/cmd/fetch.go @@ -42,7 +42,7 @@ var fetchCmd = &cobra.Command{ return err } - return runFetch(context.Background(), args[0]) + return runFetch(cmd.Context(), args[0]) }, } diff --git a/cmd/inspect.go b/cmd/inspect.go index f5519dc7..597e2e84 100644 --- a/cmd/inspect.go +++ b/cmd/inspect.go @@ -39,7 +39,7 @@ var inspectCmd = &cobra.Command{ SilenceUsage: true, FParseErrWhitelist: cobra.FParseErrWhitelist{UnknownFlags: true}, RunE: func(cmd *cobra.Command, args []string) error { - return runInspect(context.Background(), args[0]) + return runInspect(cmd.Context(), args[0]) }, } diff --git a/cmd/list.go b/cmd/list.go index 989c34c4..0c72f085 100644 --- a/cmd/list.go +++ b/cmd/list.go @@ -38,7 +38,7 @@ var listCmd = &cobra.Command{ SilenceUsage: true, FParseErrWhitelist: cobra.FParseErrWhitelist{UnknownFlags: true}, RunE: func(cmd *cobra.Command, args []string) error { - return runList(context.Background()) + return runList(cmd.Context()) }, } diff --git a/cmd/logout.go b/cmd/logout.go index b49fc794..1a8c76c1 100644 --- a/cmd/logout.go +++ b/cmd/logout.go @@ -35,7 +35,7 @@ var logoutCmd = &cobra.Command{ SilenceUsage: true, FParseErrWhitelist: cobra.FParseErrWhitelist{UnknownFlags: true}, RunE: func(cmd *cobra.Command, args []string) error { - return runLogout(context.Background(), args[0]) + return runLogout(cmd.Context(), args[0]) }, } diff --git a/cmd/modelfile/generate.go b/cmd/modelfile/generate.go index fbcf931c..bf172913 100644 --- a/cmd/modelfile/generate.go +++ b/cmd/modelfile/generate.go @@ -92,7 +92,7 @@ Full URLs with domain names will auto-detect the provider.`, return err } - return runGenerate(context.Background()) + return runGenerate(cmd.Context()) }, } diff --git a/cmd/prune.go b/cmd/prune.go index 1fbcbf3d..bea98b4e 100644 --- a/cmd/prune.go +++ b/cmd/prune.go @@ -38,7 +38,7 @@ var pruneCmd = &cobra.Command{ SilenceUsage: true, FParseErrWhitelist: cobra.FParseErrWhitelist{UnknownFlags: true}, RunE: func(cmd *cobra.Command, args []string) error { - return runPrune(context.Background()) + return runPrune(cmd.Context()) }, } diff --git a/cmd/pull.go b/cmd/pull.go index bd287120..8485b367 100644 --- a/cmd/pull.go +++ b/cmd/pull.go @@ -42,7 +42,7 @@ var pullCmd = &cobra.Command{ return err } - return runPull(context.Background(), args[0]) + return runPull(cmd.Context(), args[0]) }, } diff --git a/cmd/push.go b/cmd/push.go index e52ce05c..cd2b7d3b 100644 --- a/cmd/push.go +++ b/cmd/push.go @@ -42,7 +42,7 @@ var pushCmd = &cobra.Command{ return err } - return runPush(context.Background(), args[0]) + return runPush(cmd.Context(), args[0]) }, } diff --git a/cmd/rm.go b/cmd/rm.go index 841fd360..9cdbea39 100644 --- a/cmd/rm.go +++ b/cmd/rm.go @@ -35,7 +35,7 @@ var rmCmd = &cobra.Command{ SilenceUsage: true, FParseErrWhitelist: cobra.FParseErrWhitelist{UnknownFlags: true}, RunE: func(cmd *cobra.Command, args []string) error { - return runRm(context.Background(), args[0]) + return runRm(cmd.Context(), args[0]) }, } diff --git a/cmd/tag.go b/cmd/tag.go index 1e928882..64ceaee6 100644 --- a/cmd/tag.go +++ b/cmd/tag.go @@ -35,7 +35,7 @@ var tagCmd = &cobra.Command{ SilenceUsage: true, FParseErrWhitelist: cobra.FParseErrWhitelist{UnknownFlags: true}, RunE: func(cmd *cobra.Command, args []string) error { - return runTag(context.Background(), args[0], args[1]) + return runTag(cmd.Context(), args[0], args[1]) }, } diff --git a/cmd/upload.go b/cmd/upload.go index 186ccf2d..11b27c77 100644 --- a/cmd/upload.go +++ b/cmd/upload.go @@ -42,7 +42,7 @@ var uploadCmd = &cobra.Command{ return err } - return runUpload(context.Background(), args[0]) + return runUpload(cmd.Context(), args[0]) }, }