From de8f6e6501cbe1dcd799f0159218d682657bafe3 Mon Sep 17 00:00:00 2001 From: Erik Seliger Date: Thu, 12 Jan 2023 15:40:38 +0100 Subject: [PATCH] Fix src batch repo file parameter parsing (#919) --- CHANGELOG.md | 1 + cmd/src/batch_repositories.go | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4192528fbe..5811752909 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ All notable changes to `src-cli` are documented in this file. ### Fixed - Fix network timeout in `src users clean` occuring in instances with many users [#901](https://github.com/sourcegraph/src-cli/pull/901) +- Aligned parsing of spec file parameter of `src batch repos` with other commands. [#919](https://github.com/sourcegraph/src-cli/pull/919) ### Removed diff --git a/cmd/src/batch_repositories.go b/cmd/src/batch_repositories.go index 99c64a8688..f4b3280823 100644 --- a/cmd/src/batch_repositories.go +++ b/cmd/src/batch_repositories.go @@ -57,6 +57,11 @@ Examples: return err } + file, err := getBatchSpecFile(flagSet, fileFlag) + if err != nil { + return err + } + ctx := context.Background() client := cfg.apiClient(apiFlags, flagSet.Output()) @@ -73,11 +78,6 @@ Examples: return err } - var file string - if fileFlag != nil { - file = *fileFlag - } - out := output.NewOutput(flagSet.Output(), output.OutputOpts{Verbose: *verbose}) spec, _, _, err := parseBatchSpec(ctx, file, svc) if err != nil {