Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: default to root when module-dirs is not set #1675

Merged
merged 2 commits into from
Jun 6, 2024
Merged

Conversation

deniseli
Copy link
Contributor

@deniseli deniseli commented Jun 6, 2024

Fixes #1668

Note that this isn't usable in the ftl repo itself because go-runtime/scaffolding/{{ .Name | camel | lower }}/ftl.toml confuses the walker, so we do need to specify examples/go in our own ftl-project.toml. However, the change does WAI in normal repositories that don't have module templates.

@ftl-robot ftl-robot mentioned this pull request Jun 6, 2024
@deniseli deniseli marked this pull request as ready for review June 6, 2024 00:33
@deniseli deniseli requested a review from alecthomas as a code owner June 6, 2024 00:33
@deniseli deniseli requested review from a team and matt2e and removed request for a team June 6, 2024 00:33
@@ -34,6 +34,15 @@ type Config struct {
FTLMinVersion string `toml:"ftl-min-version"`
}

// MustGetModuleDirs returns the module-dirs field from the ftl-project.toml, unless that
// is not defined, in which case it defaults to the root directory.
func (c Config) MustGetModuleDirs() []string {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"MustX" is a pattern in Go that means "must get this thing or panic on error", so can we maybe call this "ModuleDirsOrDefault()" instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops! Thanks thanks, that's way better

@deniseli deniseli merged commit 48839a4 into main Jun 6, 2024
34 checks passed
@deniseli deniseli deleted the dli/moduledirs branch June 6, 2024 02:08
@matt2e matt2e added the approved Marks an already closed PR as approved label Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Marks an already closed PR as approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ftl dev should default to ftl dev . if no module-dirs are specified in the ftl-project.toml file
3 participants