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

Have buffrs init dir use dir instead of the current working directory #185

Closed
qsantos opened this issue Dec 6, 2023 · 3 comments · Fixed by #256
Closed

Have buffrs init dir use dir instead of the current working directory #185

qsantos opened this issue Dec 6, 2023 · 3 comments · Fixed by #256
Labels
complexity::low Issues or ideas with a low implementation cost component::cli Everything related to the buffrs cli type::fix

Comments

@qsantos
Copy link
Contributor

qsantos commented Dec 6, 2023

I was a bit surprised when buffrs init --lib units created Proto.ml and proto/ in the current working directory instead of creating a units/ directory, like Cargo would do.

The second blog post actually uses buffrs init --lib units and suggests it works (or worked) like Cargo.

The current behavior is a bit annoying, since it mean you need to mkdir and cd into the directory before running init. If that's okay, I would like for buffrs init to work as closely as cargo init as possible, even initializing a git repository if there is none. It might not be very useful for implementations, but libraries could definitely use that.

@qsantos qsantos added this to the User Experience milestone Dec 7, 2023
@qsantos qsantos added complexity::low Issues or ideas with a low implementation cost component::cli Everything related to the buffrs cli type::fix labels Dec 7, 2023
@mara-schulke
Copy link
Contributor

The behavior is inspired by cargo init / cargo new – we have only implemented init so far

@mara-schulke
Copy link
Contributor

Maybe we can implement buffrs new?

@vsiles
Copy link
Contributor

vsiles commented Feb 19, 2024

Just to clarify the possible behaviors as we might want to distinguish package names from directory names. Right now:

  • buffrs init in a directory named foo will initialize a Proto.toml with package name set to foo in the current directory foo
  • buffrs init bar in a directory named foo will initialize a Proto.toml with package name set to bar in the current directory foo

First option is to go the new / lib way:

  • buffrs new requires a mandatory package name and will create a buffrs project in a directory of that name, with a package name of the same name. I'd require the directory not to already exist to avoid having to check its content.
  • buffrs init without a package name will perform like it does now, using the name of the current directory and setting things up in .
  • buffrs init package_name will behave just like buffrs new package_name. We might allow the directory to already exist in that case. Unsure.

Now I read that the package section of Proto.toml files might go away. Would we keep the name around in that case, or use the directory name instead ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity::low Issues or ideas with a low implementation cost component::cli Everything related to the buffrs cli type::fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants