File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
framework/components/dockercompose Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 1+ - Fix 'file://' prefix validation bug
Original file line number Diff line number Diff line change @@ -45,6 +45,14 @@ func validateRepoConfiguration(repoConfig ProtoSchemaSet) error {
4545 return errors .New ("uri has to start with either 'file://' or 'https://'" )
4646 }
4747
48+ if strings .HasPrefix (repoConfig .URI , "file://" ) {
49+ if repoConfig .Ref != "" {
50+ return errors .New ("ref is not supported with local protos with 'file://' prefix" )
51+ }
52+
53+ return nil
54+ }
55+
4856 trimmedURI := strings .TrimPrefix (repoConfig .URI , "https://" )
4957 if ! strings .HasPrefix (trimmedURI , "github.com" ) {
5058 return fmt .Errorf ("only repositories hosted at github.com are supported, but %s was found" , repoConfig .URI )
@@ -55,12 +63,8 @@ func validateRepoConfiguration(repoConfig ProtoSchemaSet) error {
5563 return fmt .Errorf ("URI should have following format: 'https://github.com/<OWNER>/<REPOSITORY>', but %s was found" , repoConfig .URI )
5664 }
5765
58- if repoConfig .Ref == "" && strings .HasPrefix (repoConfig .URI , "https://" ) {
59- return errors .New ("ref is required, when fetching protos from Github" )
60- }
61-
62- if repoConfig .Ref != "" && strings .HasPrefix (repoConfig .URI , "file://" ) {
63- return errors .New ("ref is not supported with local protos" )
66+ if repoConfig .Ref == "" {
67+ return errors .New ("ref is required, when fetching protos from Github repository" )
6468 }
6569
6670 return nil
You can’t perform that action at this time.
0 commit comments