-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
cargo-init would be super nice #21
Comments
Indeed it would be. On it! |
Would it be something like rust-empty or more cargo specific? |
@thiagopnts Cargo is a replacement for rust-empty. It would be cargo-specific. My understanding is that rust-empty has a 'transition to Cargo' feature of some kind... |
From the alpha announcement:
Is it correctly understood that |
I think we actually decided on |
|
(unless you mean it's like... a projection of some abstract directory structure onto the filesystem) |
+1 |
what about |
Prior art includes:
|
+1 I miss |
Just throwing this in, |
git init initializes an existing directory, as does bundle init. We may want to have an analogue to that and use cargo new to create a new directory that is already cargoified. |
Perhaps allow the user to choose between |
This command is used to create a new cargo repository at a destination that previously does not exist. A separate command, cargo-init, will be implemented to initialize an already-existing repository. cc rust-lang#21
This should be fixed now, yes? |
I'd like to keep this open for now to keep as a reminder for a |
I'd vote for |
This command is used to create a new cargo repository at a destination that previously does not exist. A separate command, cargo-init, will be implemented to initialize an already-existing repository. cc rust-lang#21
The existing directory case is much more common than the new case. So far every time I've used cargo new it's looked like this (cursing and expletives removed): ~/dev/my-rust-project$ cargo new
Usage:
cargo new [options] <path>
cargo new -h | --help
~/dev/my-rust-project$ cargo new .
Destination `~/dev/my-rust-project` already exists
~/dev/my-rust-project$ cargo new my-rust-project
~/dev/my-rust-project$ ls
my-rust-project
$ mv my-rust-project/ ../
mv: overwrite ‘../my-rust-project’? n
~/dev/my-rust-project$ cd ..
~/dev$ mv my-rust-project/ aoeuaoeu
~/dev$ mv aoeuaoeu/my-rust-project/ ./
~/dev$ cp -r aoeuaoeu/* my-rust-project/
~/dev$ rmdir aoeuaoeu/
~/dev$ cd my-rust-project/ Not a positive user experience, to say the least. |
I've ran into this when I wanted to convert a C toy project to rust. I don't want any fancy autocargoification. I just want a template for Cargo.toml, because I don't remember its syntax. |
@andrewrk If you're working under *nix, run
It's ugly, but it works |
@ArielCabib so, getting the project working at all is not an issue. The issue is that it could be much more straightforward. Hence, this issue filed on the cargo project. Thanks for providing a workaround, but it misses the point. |
Is there opposition to this? I am willing to submit a pull request if it will be accepted. Do we want My work flow looks a lot like @andrewrk's. |
@shaleh is the |
No it is not needed. It was offered to start the conversation. On August 29, 2015 5:22:14 AM PDT, Kornel notifications@github.com wrote:
Sent from my Android phone with K-9 Mail. Please excuse my brevity. |
Allows "new" command even if path exists, if the path is empty or almost empty directory. Also more narrow duplicates: rust-lang#1990, rust-lang#1065, rust-lang#526.
Implement `cargo init` command and appropriate tests ( #21). Features: * Working like `cargo new` if there are no files in current directory * Auto-detection of `--bin` * Auto-detection of already existing VSC and appending to respecive ignore file * Appending of appropriate `[lib]` or `[[bin]]` section to `Cargo.toml` in case of some non-standard source locations Concerns: * I'm not experienced in Rust + lazy => code looks poorer compared to the rest Cargo code * The test don't cover 100% of functions * Project consisting of both binary and library is not handled * Many deviations from [previously proposed algorithm](#2008 (comment))
Now when #2081 is merged, this issue can be finally closed? |
Thanks for the reminder @rasendubi, and thanks again @vi for the implementation! |
yay!! Bummed my life got in the way but happy someone else stepped in. |
Rust beta 14, macos sierra: OZ:repositories OZ$ cd feed_importer/ |
@e-oz It looks like you specified a path, but it seems like you wanted to use the current directory. Instead of |
@carols10cents I thought I specified |
Something like cargo-init to bootstrap a new project would be very nice (mainly creating the toml file if it does not exist and maybe other flags in the future)
The text was updated successfully, but these errors were encountered: