diff --git a/cmd/network-crawler/network-crawler.go b/cmd/network-crawler/network-crawler.go index 4427b8e..c635064 100644 --- a/cmd/network-crawler/network-crawler.go +++ b/cmd/network-crawler/network-crawler.go @@ -68,6 +68,10 @@ func run() error { flag.Var(&flagSkippedProviders, "skipped-providers", skippedProvidersUsage) flag.Parse() + if flagBucketName == nil || *flagBucketName == "" { + return common.NoBucketNameSpecified() + } + if *flagDryRun { log.Print("Dry run specified. Instead of uploading the content to bucket will just print to stdout.") } diff --git a/go.mod b/go.mod index 0799df1..459efcd 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,6 @@ require ( github.com/golangci/golangci-lint v1.32.2 // indirect github.com/google/martian/v3 v3.1.0 // indirect github.com/kr/text v0.2.0 // indirect - github.com/mattn/go-colorable v0.1.8 // indirect github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.6.1 diff --git a/go.sum b/go.sum index e13827d..94e8533 100644 --- a/go.sum +++ b/go.sum @@ -92,7 +92,6 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= diff --git a/pkg/common/errors.go b/pkg/common/errors.go index 78b9a7d..9fe6a87 100644 --- a/pkg/common/errors.go +++ b/pkg/common/errors.go @@ -69,3 +69,8 @@ func ErroneousPrefixOrderingError(bucketName string, prefixes []string) error { len(prefixes), prefixes) } + +// NoBucketNameSpecified is returned when the script is invoked without a bucket name +func NoBucketNameSpecified() error { + return errors.New("bucket name not specified") +}