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

feat(sails-cli): Similar behavior to cargo new ... if executed within a workspace #504

Open
gshep opened this issue Aug 30, 2024 · 0 comments

Comments

@gshep
Copy link
Member

gshep commented Aug 30, 2024

Problem to Solve

If one runs cargo new ... within a workspace cargo detects that and modifies the workspace's Cargo.toml accordingly. For example:

gear-tech/gear/examples$ cargo new new-example --lib
     Created library `new-example` package
gear-tech/gear/examples$ cd ..
gear-tech/gear$ git st
On branch branch
Your branch is ahead of 'origin/breanch' by 1 commit.
  (use "git push" to publish your local commits)

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   Cargo.toml

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        examples/new-example/

no changes added to commit (use "git add" and/or "git commit -a")

$ git diff
diff --git a/Cargo.toml b/Cargo.toml
index 965527c51..f8edd3923 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -99,7 +99,7 @@ members = [
     "runtime/*",
     "utils/*",
     "utils/runtime-fuzzer/fuzz"
-]
+, "examples/new-example"]
 
 [workspace.dependencies]
 anyhow = "1.0.81"

However for cargo-sails new-program ... it looks like:

$ cargo-sails new-program new-sails-example 
gear-tech/gear/examples$ cd ..
gear-tech/gear$ git st
On branch branch
Your branch is ahead of 'origin/branch' by 1 commit.
  (use "git push" to publish your local commits)

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        examples/new-sails-example/

nothing added to commit but untracked files present (use "git add" to track)

It would be nice to repeat after cargo new ... and define all new sails project (workspace) members in the workspace's Cargo.toml.

Possible Solution

to research

Notes

No response

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

No branches or pull requests

1 participant