Skip to content

Commit

Permalink
allow no services
Browse files Browse the repository at this point in the history
  • Loading branch information
HomelessDinosaur committed Dec 29, 2024
1 parent 69c84b2 commit 6ee07b7
Showing 1 changed file with 4 additions and 8 deletions.
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

0 comments on commit 6ee07b7

Please sign in to comment.