rust3ds / cargo-3ds

Cargo command to work with Nintendo 3DS project binaries.
Apache License 2.0
59 stars 10 forks source link

General refactoring and cargo-new #36

Closed Meziu closed 1 year ago

Meziu commented 1 year ago

Closes #29 Closes #14 Would also resolve issues such as: discussions#127

This PR includes support for the cargo 3ds new command, as well as a small refactoring of the project needed to implement the new functionality.

List of changes:

I will update the ctru-rs wiki shortly after this PR merges to briefly explain the new functionality.

With this PR I intend to officially release cargo-3ds via crates.io. I haven't had any issues with cargo-3ds for months now, and the support has only grown bigger. We can start publishing this tool as Rust3DS' first official crate, since its clearly the most mature.

Edit: I forgot to say why I decided not to implement cargo 3ds init as well. While it wouldn’t have been hard to implement it the same way as new, it posed immense issues in how we would got about actually modifying the context. cargo-init, the official one, takes an existing directory and adds to it all the files and config that would normally appear when running cargo-new. However, it does not modify existing files that correspond to the project files (e.g. if src/main.rs already exists, it skips over its initialisation). This means that by the end of the command, the folder will look more or less exactly as it would after running new, but in this case, we aren’t certain that the files present are brand new, and there’s no way of knowing that. Modifying the Cargo.toml or making a custom main.rs replacing the original one would be disastrous. The only way to solve such an issue would be to completely rewrite cargo-init, but that seems a bit out of scope for this tool.