-
Notifications
You must be signed in to change notification settings - Fork 422
fix: detect server subfolder in init #566
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
base: main
Are you sure you want to change the base?
fix: detect server subfolder in init #566
Conversation
Thanks! Are you able to fix the merge conflicts and we can get this shipped 🚀 |
7a3e409
to
514c92d
Compare
awesome, glad to hear it @domdomegg! I rebased and fixed the merge conflicts :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Left a small comment 👍
cmd/publisher/commands/init.go
Outdated
// If we're in a subdirectory, use the current folder name | ||
if subfolder != "" { | ||
if cwd, err := os.Getwd(); err == nil { | ||
folderName := filepath.Base(cwd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems we use subfolder
as a boolean even though it's a string. Wouldn't it be better to reuse the subfolder variable we already have?
For example if it's != "" construct the path using it (and avoid reading the base path again), otherwise proceed as if we are in the root repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're completely right, I pushed a fix
Motivation and Context
Discussion from this issue: #538
We want to make it clearer that repo name & server name do not HAVE to be the same, especially in monorepos.
@tadasant this seems like a minor thing that doesn't have to be documented specifically, lmk if you disagree :)
How Has This Been Tested?
Tested the init flow locally, running the built
init
command from a subfolder and the repo root.Breaking Changes
No
Types of changes
Checklist
Additional context