Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions pkg/project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ func (p *Project) GetBatchServices() []Batch {
func (p *Project) BuildBatches(fs afero.Fs, useBuilder bool) (chan ServiceBuildUpdate, error) {
updatesChan := make(chan ServiceBuildUpdate)

if len(p.services) == 0 {
return nil, fmt.Errorf("no services found in project, nothing to build. This may indicate misconfigured `match` patterns in your nitric.yaml file")
}

maxConcurrentBuilds := make(chan struct{}, min(goruntime.NumCPU(), goruntime.GOMAXPROCS(0)))

waitGroup := sync.WaitGroup{}
Expand Down Expand Up @@ -130,10 +126,6 @@ func (p *Project) BuildBatches(fs afero.Fs, useBuilder bool) (chan ServiceBuildU
func (p *Project) BuildServices(fs afero.Fs, useBuilder bool) (chan ServiceBuildUpdate, error) {
updatesChan := make(chan ServiceBuildUpdate)

if len(p.services) == 0 {
return nil, fmt.Errorf("no services found in project, nothing to build. This may indicate misconfigured `match` patterns in your nitric.yaml file")
}

maxConcurrentBuilds := make(chan struct{}, min(goruntime.NumCPU(), goruntime.GOMAXPROCS(0)))

waitGroup := sync.WaitGroup{}
Expand Down Expand Up @@ -573,6 +565,10 @@ func fromProjectConfiguration(projectConfig *ProjectConfiguration, localConfig *
return nil, fmt.Errorf("unable to match service files for pattern %s: %w", serviceMatch, err)
}

if len(files) == 0 {
return nil, fmt.Errorf("unable to match service files for pattern %s. This may indicate misconfigured `match` patterns in your nitric.yaml file", serviceMatch)
}

for _, f := range files {
relativeServiceEntrypointPath, _ := filepath.Rel(filepath.Join(projectConfig.Directory, baseService.GetBasedir()), f)
projectRelativeServiceFile := filepath.Join(projectConfig.Directory, f)
Expand Down
Loading