Skip to content

Fix cargo new for non-existing directory#12

Merged
CeleritasCelery merged 1 commit intomainfrom
fix-cargo-new
May 19, 2024
Merged

Fix cargo new for non-existing directory#12
CeleritasCelery merged 1 commit intomainfrom
fix-cargo-new

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
@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