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

Fix cargo new for non-existing directory #12

Merged
merged 1 commit into from
May 19, 2024
Merged

Conversation

CeleritasCelery
Copy link
Contributor

Original description by @roife in brotzeit/rustic#540 :

fix brotzeit/rustic#506.

The current implementation of rustic-cargo-new utilizes D within interactive, necessitating an existing path. However, the functionality of cargo new allows arguments for non-existing paths and automatically generates directories.

For instance, when executing cargo new a1/a2 within ~/source, Cargo generates a directory named a1 and a subdirectory a2 within a1. Subsequently, cargo new initializes a package within ~/source/a1/a2.

This proposed patch aims to enhance rustic-cargo-new by enabling acceptance of arbitrary paths. It will then determine the longest existing prefix of the path as the default-directory, utilizing the remainder as the project-name passed to cargo new.

@CeleritasCelery CeleritasCelery merged commit d0f8392 into main May 19, 2024
4 checks passed
@CeleritasCelery CeleritasCelery deleted the fix-cargo-new branch May 19, 2024 19:15
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.

rustic-cargo-new has a little problem
2 participants