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

Add init subcommand #15

Merged
merged 1 commit into from
Oct 17, 2020
Merged

Add init subcommand #15

merged 1 commit into from
Oct 17, 2020

Conversation

mattsse
Copy link
Contributor

@mattsse mattsse commented Aug 29, 2020

This adds a new subcommand init to create a virtual workspace.

a virtual workspace is a workspace where the root Cargo.toml manifest does not define a package, and only lists the workspace members.

This can be useful to quickly setup a Cargo.toml at the root of a mono-repo that includes nested cargo packages somewhere in its tree.

Example:

For:

app
└── rust
    ├── cli
    │   └── app
    │       ├── Cargo.toml
    │       └── src
    │           └── main.rs
    └── core
        ├── backend
        │   ├── Cargo.toml
        │   └── src
        │       └── main.rs
        └── command
            ├── Cargo.toml
            └── src
                └── main.rs

cargo ws init within the app directory will create the following Cargo.toml at app/Cargo.toml:

[workspace]
members = [
    "rust/cli/app",
    "rust/core/backend",
    "rust/core/command",
]

cargo-workspaces/src/init.rs Outdated Show resolved Hide resolved
Copy link
Owner

@pksunkara pksunkara left a comment

Choose a reason for hiding this comment

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

Please add the init command to the README and CHANGELOG. Also, since this command doesn't use git, you should be able to test this command. So, please add some tests too.

@@ -0,0 +1,71 @@
use crate::utils::info;
use crate::utils::{Error, Result};
Copy link
Owner

Choose a reason for hiding this comment

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

Merge these 2 lines please.

@pksunkara
Copy link
Owner

@mattsse Are you planning to finish this?

@pksunkara pksunkara merged commit 58d8fc7 into pksunkara:master Oct 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants